cositas en la BD

This commit is contained in:
Cat /dev/Nulo 2024-04-12 20:32:35 -03:00
parent b715781b07
commit 38b6b62aba

View file

@ -10,6 +10,12 @@ let db = null;
export function getDb() {
if (db) return db;
const sqlite = new Database(DB_PATH);
sqlite.exec(`PRAGMA journal_mode = WAL;`);
sqlite.exec(`PRAGMA busy_timeout = 15000;`);
sqlite.exec(`PRAGMA synchronous = NORMAL;`);
sqlite.exec(`PRAGMA cache_size = 1000000000;`);
sqlite.exec(`PRAGMA foreign_keys = true;`);
sqlite.exec(`PRAGMA temp_store = memory;`);
db = drizzle(sqlite, { schema, logger: true });
migrateDb(db);
return db;