add optional upper_bound_inclusive parameter to some checkpoint modes

- will be used in sync-engine protocol
This commit is contained in:
Nikita Sivukhin
2025-08-19 20:27:01 +04:00
parent 306bc7e264
commit 05931f70ce
6 changed files with 226 additions and 35 deletions

View File

@@ -1345,9 +1345,13 @@ pub unsafe extern "C" fn sqlite3_wal_checkpoint_v2(
let db: &mut sqlite3 = &mut *db;
let db = db.inner.lock().unwrap();
let chkptmode = match mode {
SQLITE_CHECKPOINT_PASSIVE => CheckpointMode::Passive,
SQLITE_CHECKPOINT_PASSIVE => CheckpointMode::Passive {
upper_bound_inclusive: None,
},
SQLITE_CHECKPOINT_RESTART => CheckpointMode::Restart,
SQLITE_CHECKPOINT_TRUNCATE => CheckpointMode::Truncate,
SQLITE_CHECKPOINT_TRUNCATE => CheckpointMode::Truncate {
upper_bound_inclusive: None,
},
SQLITE_CHECKPOINT_FULL => CheckpointMode::Full,
_ => return SQLITE_MISUSE, // Unsupported mode
};