aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-07-02 22:32:44 +0200
committerKim Alvefur <zash@zash.se>2015-07-02 22:32:44 +0200
commit3dd49f5620ef6860767fee2904399a77e242e10e (patch)
treebd2ae03829e25ec93e32331db4e13a1f350a8637 /util
parent723c6ffe7e5ceb9e9236d9c54d0d4eba1162370d (diff)
downloadprosody-3dd49f5620ef6860767fee2904399a77e242e10e.tar.gz
prosody-3dd49f5620ef6860767fee2904399a77e242e10e.zip
util.sql: Call onconnect, provide noop dummy if not set
Diffstat (limited to 'util')
-rw-r--r--util/sql.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/util/sql.lua b/util/sql.lua
index 5aa12f94..92032f43 100644
--- a/util/sql.lua
+++ b/util/sql.lua
@@ -111,8 +111,12 @@ function engine:connect()
self.conn = dbh;
self.prepared = {};
self:set_encoding();
+ self:onconnect();
return true;
end
+function engine:onconnect()
+ -- Override from create_engine()
+end
function engine:execute(sql, ...)
local success, err = self:connect();
if not success then return success, err; end