ic_sqlite_vfs/config.rs
1//! Central runtime constants for the SQLite-on-stable-memory layout.
2//!
3//! Keeping offsets and PRAGMA values here prevents hidden magic numbers in VFS
4//! callbacks, migrations, and canister API code.
5
6pub const SQLITE_PAGE_SIZE: u32 = 16_384;
7pub const SQLITE_CACHE_SIZE_KIB: i32 = 32_768;
8pub const BUSY_TIMEOUT_MS: u64 = 0;
9
10pub const STABLE_PAGE_SIZE: u64 = 65_536;
11pub const SUPERBLOCK_OFFSET: u64 = 0;
12pub const SUPERBLOCK_SIZE: u64 = STABLE_PAGE_SIZE;
13pub const DB_REGION_OFFSET: u64 = SUPERBLOCK_OFFSET + SUPERBLOCK_SIZE;
14
15pub const MAIN_DB_PATH: &str = "/main.db";
16pub const VFS_NAME: &str = "icstable";
17pub const SQLITE_URI: &str = "file:/main.db?vfs=icstable";