Explicitly choose the setting of temp_store in better sqlite.

Memory isn't the default.

Co-authored-by: Bea <20361868+enbea@users.noreply.github.com>
This commit is contained in:
gnuxie
2025-03-21 16:19:09 +00:00
co-authored by Bea
parent 522eae6ce2
commit b5e3ebb53a
@@ -24,7 +24,9 @@ export function makeBetterSqliteDB(
): Database {
log.info("Opening db: ", options.path);
const db = new BetterSqlite3(options.path, options);
if (options.path !== ":memory:") {
if (options.path === ":memory:") {
db.pragma("temp_store = memory");
} else {
db.pragma("temp_store = file"); // Avoid unnecessary memory usage.
}
if (options.WALMode) {