Changeset

6748:ccf4fcfc2024

util.sql: Call onconnect, provide noop dummy if not set
author Kim Alvefur <zash@zash.se>
date Thu, 02 Jul 2015 22:32:44 +0200
parents 6747:14c52ca661b6
children 6749:9dc05d3efdc9 6751:18f18bceb662
files util/sql.lua
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/util/sql.lua	Sat Jun 27 16:45:31 2015 +0200
+++ b/util/sql.lua	Thu Jul 02 22:32:44 2015 +0200
@@ -111,8 +111,12 @@
 	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