// Stands in for https://esm.town/v/std/sqlite/main.ts: the val's own // SQLite database, now a file at /data/sqlite.db. Same client // (@libsql/client), so execute(), batch() and their results are unchanged. import { createClient } from "npm:@libsql/client@0.18"; const dir = Deno.env.get("VAL_DATA") ?? `${Deno.cwd()}/data`; await Deno.mkdir(dir, { recursive: true }); export const sqlite = createClient({ url: `file:${dir}/sqlite.db` }); await sqlite.execute("PRAGMA journal_mode = WAL"); await sqlite.execute("PRAGMA busy_timeout = 5000"); export default sqlite;