aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authordanielk1977 <danielk1977@noemail.net>2005-12-15 15:22:08 +0000
committerdanielk1977 <danielk1977@noemail.net>2005-12-15 15:22:08 +0000
commit94eb6a14cb7ad11ef7c95f22eec093f77c5a71d8 (patch)
tree4c94820844ccd12a32b0fc49c64c42d300ea06a5 /src/main.c
parentc529f520468ca3bd701d009339d336c8618cf921 (diff)
downloadsqlite-94eb6a14cb7ad11ef7c95f22eec093f77c5a71d8.tar.gz
sqlite-94eb6a14cb7ad11ef7c95f22eec093f77c5a71d8.zip
Add the sqlite3_update_hook() API. (CVS 2820)
FossilOrigin-Name: 36229018817eebfbfca7a66d2285e4faf7b39845
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 5117200c9..8bc6bb885 100644
--- a/src/main.c
+++ b/src/main.c
@@ -14,7 +14,7 @@
** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
-** $Id: main.c,v 1.309 2005/12/15 03:04:10 drh Exp $
+** $Id: main.c,v 1.310 2005/12/15 15:22:09 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -548,6 +548,19 @@ void *sqlite3_commit_hook(
return pOld;
}
+/*
+** Register a callback to be invoked each time a row is updated,
+** inserted or deleted using this database connection.
+*/
+void sqlite3_update_hook(
+ sqlite3 *db, /* Attach the hook to this database */
+ void (*xCallback)(void*,int,char const *,char const *,sqlite_int64),
+ void *pArg /* Argument to the function */
+){
+ db->xUpdateCallback = xCallback;
+ db->pUpdateArg = pArg;
+}
+
/*
** This routine is called to create a connection to a database BTree