diff --git a/main.ts b/main.ts index 9317322..36232fe 100644 --- a/main.ts +++ b/main.ts @@ -22,6 +22,22 @@ interface Db { createSession(init: Omit): Promise; } +try { + await Deno.lstat("bunker.db"); +} catch (error) { + if (!(error instanceof Deno.errors.NotFound)) { + throw error; + } + const cmd = new Deno.Command("sqlite3", { + args: ["bunker.db", ".read database.sql"], + stdout: "piped", + stderr: "piped", + }); + console.log( + await cmd.output().then((out) => new TextDecoder().decode(out.stdout)), + ); +} + class SqliteDb implements Db { private db = new sqlite.Database("bunker.db", { create: false });