diff util/sql.lua @ 13715:edd006093533 13.0

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.
author Kim Alvefur <zash@zash.se>
date Sun, 16 Feb 2025 11:52:07 +0100
parents 844e7bf7b48a
children e7c52d0b0e0d
line wrap: on
line diff
--- a/util/sql.lua	Sat Feb 15 17:10:30 2025 +0000
+++ b/util/sql.lua	Sun Feb 16 11:52:07 2025 +0100
@@ -84,7 +84,7 @@
 	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;