Comparison

util/sql.lua @ 6752:3cc2bc9c1bff

Merge with 0.10
author Matthew Wild <mwild1@gmail.com>
date Mon, 06 Jul 2015 17:07:05 +0100
parent 6748:ccf4fcfc2024
child 6758:88b89facc3c9
comparison
equal deleted inserted replaced
6750:2a2eb30b1ed4 6752:3cc2bc9c1bff
109 if not dbh then return nil, err; end 109 if not dbh then return nil, err; end
110 dbh:autocommit(false); -- don't commit automatically 110 dbh:autocommit(false); -- don't commit automatically
111 self.conn = dbh; 111 self.conn = dbh;
112 self.prepared = {}; 112 self.prepared = {};
113 self:set_encoding(); 113 self:set_encoding();
114 self:onconnect();
114 return true; 115 return true;
116 end
117 function engine:onconnect()
118 -- Override from create_engine()
115 end 119 end
116 function engine:execute(sql, ...) 120 function engine:execute(sql, ...)
117 local success, err = self:connect(); 121 local success, err = self:connect();
118 if not success then return success, err; end 122 if not success then return success, err; end
119 local prepared = self.prepared; 123 local prepared = self.prepared;