Add experimental API sqlite3_db_cacheflush().

FossilOrigin-Name: 65b86dc1fa4a57cc3cde86a820d9f848aa288a15
This commit is contained in:
dan
2015-10-28 19:46:57 +00:00
parent 9109b7f8e1
commit 6fa255fd5c
9 changed files with 391 additions and 12 deletions
+29
View File
@@ -4688,6 +4688,34 @@ static int test_db_release_memory(
return TCL_OK;
}
/*
** Usage: sqlite3_db_cacheflush DB
**
** Attempt to flush any dirty pages to disk.
*/
static int test_db_cacheflush(
void * clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *CONST objv[]
){
sqlite3 *db;
int rc;
if( objc!=2 ){
Tcl_WrongNumArgs(interp, 1, objv, "DB");
return TCL_ERROR;
}
if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR;
rc = sqlite3_db_cacheflush(db);
if( rc ){
Tcl_SetResult(interp, (char *)sqlite3ErrStr(rc), TCL_STATIC);
return TCL_ERROR;
}
Tcl_ResetResult(interp);
return TCL_OK;
}
/*
** Usage: sqlite3_db_filename DB DBNAME
**
@@ -6876,6 +6904,7 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
{ "sqlite3_release_memory", test_release_memory, 0},
{ "sqlite3_db_release_memory", test_db_release_memory, 0},
{ "sqlite3_db_cacheflush", test_db_cacheflush, 0},
{ "sqlite3_db_filename", test_db_filename, 0},
{ "sqlite3_db_readonly", test_db_readonly, 0},
{ "sqlite3_soft_heap_limit", test_soft_heap_limit, 0},