mirror of
https://github.com/MrTalon63/NeoMap.git
synced 2026-01-11 20:09:13 +01:00
Prepare for litestream
This commit is contained in:
parent
da52fcb9c1
commit
72f3ee840c
1 changed files with 2 additions and 1 deletions
|
|
@ -2,4 +2,5 @@ import { Database } from "jsr:@db/sqlite@0.12.0";
|
||||||
|
|
||||||
export const db = await new Database(Deno.env.get("DB_PATH") || "./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();
|
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();
|
||||||
db.exec("pragma journal_mode = WAL");
|
db.exec("PRAGMA journal_mode = WAL;");
|
||||||
|
db.exec("PRAGMA busy_timeout = 5000;");
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue