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.
This commit is contained in:
Kim Alvefur 2025-02-16 11:52:07 +01:00
parent 9bae17a0bb
commit 037c70246d

View file

@ -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;