From 037c70246dc7715c896e00b3d177d61499c9d7ee Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 16 Feb 2025 11:52:07 +0100 Subject: util.sql: Don't send SQLCipher key to Postgres or MySQL (thanks gllmhyt) This was copied from util.sqlite3 which only deals with SQLite3, but here Postgres or MySQL are also possibilities, which wouldn't support this. --- util/sql.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/sql.lua b/util/sql.lua index 2f0ec493..06550455 100644 --- a/util/sql.lua +++ b/util/sql.lua @@ -84,7 +84,7 @@ function engine:connect() dbh:autocommit(false); -- don't commit automatically self.conn = dbh; self.prepared = {}; - if params.password then + if params.driver == "SQLite3" and params.password then local ok, err = self:execute(("PRAGMA key='%s'"):format(dbh:quote(params.password))); if not ok then return ok, err; -- cgit v1.2.3