1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Add the sqlite3_log_hook() interface for scheduling checkpoints.

FossilOrigin-Name: 9bda601455705475075e33bfa85687bce34b15ff
This commit is contained in:
dan
2010-04-19 18:03:51 +00:00
parent 54934f4689
commit 8d22a17411
14 changed files with 281 additions and 56 deletions

View File

@@ -1186,6 +1186,24 @@ void *sqlite3_rollback_hook(
return pRet;
}
/*
** Register a callback to be invoked each time a transaction is written
** into the write-ahead-log by this database connection.
*/
void *sqlite3_log_hook(
sqlite3 *db, /* Attach the hook to this db handle */
int(*xCallback)(void *, sqlite3*, const char*, int),
void *pArg /* First argument passed to xCallback() */
){
void *pRet;
sqlite3_mutex_enter(db->mutex);
pRet = db->pLogArg;
db->xLogCallback = xCallback;
db->pLogArg = pArg;
sqlite3_mutex_leave(db->mutex);
return pRet;
}
/*
** This function returns true if main-memory should be used instead of
** a temporary file for transient pager files and statement journals.