mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
core: add tempStore option to DB
This commit is contained in:
committed by
Abdullah Atta
parent
5612820aac
commit
96181e73dd
@@ -201,6 +201,7 @@ export type SQLiteOptions = {
|
||||
journalMode?: "WAL" | "MEMORY" | "OFF" | "PERSIST" | "TRUNCATE" | "DELETE";
|
||||
synchronous?: "normal" | "extra" | "full" | "off";
|
||||
lockingMode?: "normal" | "exclusive";
|
||||
tempStore?: "memory" | "file" | "default";
|
||||
cacheSize?: number;
|
||||
pageSize?: number;
|
||||
};
|
||||
@@ -228,6 +229,9 @@ export async function createDatabase(options: SQLiteOptions) {
|
||||
options.pageSize.toString()
|
||||
)}`.execute(db);
|
||||
|
||||
if (options.tempStore)
|
||||
await sql`PRAGMA temp_store = ${sql.raw(options.tempStore)}`.execute(db);
|
||||
|
||||
if (options.cacheSize)
|
||||
await sql`PRAGMA cache_size = ${sql.raw(
|
||||
options.cacheSize.toString()
|
||||
|
||||
Reference in New Issue
Block a user