diff options
author | danielk1977 <danielk1977@noemail.net> | 2005-12-15 15:22:08 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2005-12-15 15:22:08 +0000 |
commit | 94eb6a14cb7ad11ef7c95f22eec093f77c5a71d8 (patch) | |
tree | 4c94820844ccd12a32b0fc49c64c42d300ea06a5 /src/main.c | |
parent | c529f520468ca3bd701d009339d336c8618cf921 (diff) | |
download | sqlite-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.c | 15 |
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 |