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

Add the "PRAGMA wal_autocheckpoint" command. Rename "PRAGMA checkpoint" to "PRAGMA wal_checkpoint".

FossilOrigin-Name: 714e5947264571386f966aa8fcdd5607b5832238
This commit is contained in:
dan
2010-05-03 11:05:08 +00:00
parent 11398e5e54
commit 5a299f9134
14 changed files with 135 additions and 72 deletions

View File

@@ -1402,13 +1402,30 @@ void sqlite3Pragma(
#ifndef SQLITE_OMIT_WAL
/*
** PRAGMA [database.]checkpoint
** PRAGMA [database.]wal_checkpoint
**
** Checkpoint the database.
*/
if( sqlite3StrICmp(zLeft, "checkpoint")==0 ){
if( sqlite3StrICmp(zLeft, "wal_checkpoint")==0 ){
if( sqlite3ReadSchema(pParse) ) goto pragma_out;
sqlite3VdbeAddOp3(v, OP_Checkpoint, iDb, 0, 0);
}else
/*
** PRAGMA wal_autocheckpoint
** PRAGMA wal_autocheckpoint = N
**
** Configure a database connection to automatically checkpoint a database
** after accumulating N frames in the log. Or query for the current value
** of N.
*/
if( sqlite3StrICmp(zLeft, "wal_autocheckpoint")==0 ){
if( zRight ){
int nAuto = atoi(zRight);
sqlite3_wal_autocheckpoint(db, nAuto);
}
returnSingleInt(pParse, "wal_autocheckpoint", db->nAutoCheckpoint);
}else
#endif
#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST)