aboutsummaryrefslogtreecommitdiffstats
path: root/util/sqlite3.lua
diff options
context:
space:
mode:
Diffstat (limited to 'util/sqlite3.lua')
-rw-r--r--util/sqlite3.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/util/sqlite3.lua b/util/sqlite3.lua
index 470eb46d..fec2d162 100644
--- a/util/sqlite3.lua
+++ b/util/sqlite3.lua
@@ -114,6 +114,12 @@ function engine:connect()
if not dbh then return nil, err; end
self.conn = dbh;
self.prepared = {};
+ if params.password then
+ local ok, err = self:execute(("PRAGMA key='%s'"):format((params.password:gsub("'", "''"))));
+ if not ok then
+ return ok, err;
+ end
+ end
local ok, err = self:set_encoding();
if not ok then
return ok, err;