From bb7db3926ee99033d08fcb0b630ee8afcc7165b3 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 20 Nov 2025 12:07:15 +1030 Subject: [PATCH] sql: if we use `dev-sqlfilename`, don't bother syncing it to disk. Signed-off-by: Rusty Russell --- plugins/sql.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/sql.c b/plugins/sql.c index c73eb6787..cf0066d3d 100644 --- a/plugins/sql.c +++ b/plugins/sql.c @@ -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; }