From 7ed8f8d85bed4ff46afb2bf80a2d9bc6c63347c8 Mon Sep 17 00:00:00 2001 From: Marcin Czop Date: Thu, 30 Jan 2025 04:29:58 +0100 Subject: [PATCH] Get DB path from env --- src/db.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/db.ts b/src/db.ts index 6f535e5..96e8da3 100644 --- a/src/db.ts +++ b/src/db.ts @@ -1,4 +1,4 @@ import { Database } from "jsr:@db/sqlite@0.12.0"; -export const db = await new Database("./neomap.sqlite"); +export const db = await new Database(Deno.env.get("DB_PATH") || "./neomap.sqlite"); db.prepare("CREATE TABLE IF NOT EXISTS hexes (hex_id TEXT PRIMARY KEY NOT NULL CHECK(hex_id GLOB '[0-9a-f]*'), wifi INTEGER DEFAULT 0 NOT NULL, gsm INTEGER DEFAULT 0 NOT NULL, wcdma INTEGER DEFAULT 0 NOT NULL, lte INTEGER DEFAULT 0 NOT NULL, ble INTEGER DEFAULT 0 NOT NULL, created_at INTEGER DEFAULT (strftime('%s', 'now')) NOT NULL, last_update INTEGER DEFAULT (strftime('%s', 'now')) NOT NULL);").run();