Initialize cold WAL bookkeeping for subprocess snapshots

This commit is contained in:
syntaxbullet
2026-09-08 16:31:58 +02:00
parent 27beb01144
commit 7c7a048b32
3 changed files with 38 additions and 3 deletions

View File

@@ -1,5 +1,7 @@
import { Database } from "bun:sqlite";
import { databasePath } from "../src/db/config";
import { backupConfig, createBackup } from "../src/ops/backups";
const db = new Database(databasePath, { readonly: true, strict: true });
// SQLite needs writable WAL bookkeeping when the first snapshot opens a cold database.
// Only snapshot SQL runs here; never create a missing source file.
const db = new Database(databasePath, { readwrite: true, create: false, strict: true });
try { console.log(createBackup(db, backupConfig(databasePath))); } finally { db.close(); }