sql: if we use dev-sqlfilename, don't bother syncing it to disk.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2025-11-20 12:07:15 +10:30
parent b63034bd37
commit bb7db3926e

View File

@@ -268,6 +268,17 @@ static struct sqlite3 *sqlite_setup(struct plugin *plugin)
if (err != SQLITE_OK)
plugin_err(plugin, "Could not set foreign_keys: %s", errmsg);
if (sql->dbfilename) {
err = sqlite3_exec(db,
"PRAGMA synchronous = OFF;"
"PRAGMA journal_mode = OFF;"
"PRAGMA temp_store = MEMORY;"
, NULL, NULL,
&errmsg);
if (err != SQLITE_OK)
plugin_err(plugin, "Could not disable sync: %s", errmsg);
}
return db;
}