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:
18
src/main.c
18
src/main.c
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user