export type SQLiteKVStoreOptions = { /** * Expected storage size of the system in bytes that SQLite may use. This does not put a hard limit on the size of the database, but it is used to influence WAL checkpointing and truncation. * The default is 5GB. */ storageSize?: number; /** * The maximum size of the WAL file before it is truncated. This is used to limit the size of the WAL file and prevent it from growing indefinitely. * The default is 2.5% of the storage size. */ journalSizeLimit?: number; /** * The number of pages in the WAL file that will trigger a (PASSIVE) checkpoint. This is used to control the frequency of checkpoints and prevent the WAL file from growing too large. * The default is journal_size_limit / page_size. */ walAutocheckpoint?: number; /** * Set greater than journal_size_limit. This is used to control the frequency of checkpoints and prevent the WAL file from growing too large. * The default is 5% of the storage size. */ checkpointRestart?: number; /** * Set greater than journal_size_limit. This is used to control the frequency of checkpoints and prevent the WAL file from growing too large. * The default is 20% of the storage size. */ checkpointTruncate?: number; /** * Additional custom pragma settings to be applied to the SQLite database. This can be used to set various SQLite options and configurations. Default PRAGMA statements will still be applied, so must be overridden if you want to change them. */ pragma?: string; }; export declare const STATEMENTS: Readonly<{ /** * Create the table if it doesn't exist. * * We use `WITHOUT ROWID` to create a clustered index on the `key` column to improve locality during range scans. */ createTable: "CREATE TABLE IF NOT EXISTS data (key TEXT PRIMARY KEY, value TEXT) WITHOUT ROWID"; get: "SELECT value FROM data WHERE key = ?"; scan: "SELECT key, value FROM data WHERE key >= ? AND key < ?"; scanValues: "SELECT value FROM data WHERE key >= ? AND key < ?"; count: "SELECT COUNT(*) FROM data"; countRange: "SELECT COUNT(*) FROM data WHERE key >= ? AND key < ?"; set: "INSERT OR REPLACE INTO data VALUES (?, ?)"; delete: "DELETE FROM data WHERE key = ?"; deleteRange: "DELETE FROM data WHERE key >= ? AND key < ?"; truncate: "DELETE FROM data"; }>; export declare const CHECKPOINT_RESTART = "PRAGMA wal_checkpoint(RESTART);"; export declare const CHECKPOINT_TRUNCATE = "PRAGMA wal_checkpoint(TRUNCATE);"; export declare function parseSqliteKvStoreOptions(options: SQLiteKVStoreOptions): Required;