import type { Database } from "bun:sqlite"; export function getMetaValue(database: Database, key: string): string | null { const row = database .query("SELECT value FROM schema_meta WHERE key = ?1") .get(key) as { value: string } | null; return row?.value ?? null; } export function setMetaValue(database: Database, key: string, value: string): void { database .query( `INSERT INTO schema_meta (key, value) VALUES (?1, ?2) ON CONFLICT(key) DO UPDATE SET value = excluded.value`, ) .run(key, value); }