mirror of
https://github.com/catdevnull/preciazo.git
synced 2024-11-22 14:16:19 +00:00
cositas en la BD
This commit is contained in:
parent
b715781b07
commit
38b6b62aba
1 changed files with 6 additions and 0 deletions
|
@ -10,6 +10,12 @@ let db = null;
|
||||||
export function getDb() {
|
export function getDb() {
|
||||||
if (db) return db;
|
if (db) return db;
|
||||||
const sqlite = new Database(DB_PATH);
|
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 });
|
db = drizzle(sqlite, { schema, logger: true });
|
||||||
migrateDb(db);
|
migrateDb(db);
|
||||||
return db;
|
return db;
|
||||||
|
|
Loading…
Reference in a new issue