Software /
code /
prosody
Comparison
util/sql.lua @ 6532:a966efeb6cb3
mod_storage_sql2, util.sql: Set character encoding on every connect
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 11 Dec 2014 09:18:39 +0100 |
parent | 5919:d1cc67ed0767 |
child | 6730:7889515bac86 |
comparison
equal
deleted
inserted
replaced
6531:18f4973849b1 | 6532:a966efeb6cb3 |
---|---|
154 ); | 154 ); |
155 if not dbh then return nil, err; end | 155 if not dbh then return nil, err; end |
156 dbh:autocommit(false); -- don't commit automatically | 156 dbh:autocommit(false); -- don't commit automatically |
157 self.conn = dbh; | 157 self.conn = dbh; |
158 self.prepared = {}; | 158 self.prepared = {}; |
159 self:set_encoding(); | |
159 return true; | 160 return true; |
160 end | 161 end |
161 function engine:execute(sql, ...) | 162 function engine:execute(sql, ...) |
162 local success, err = self:connect(); | 163 local success, err = self:connect(); |
163 if not success then return success, err; end | 164 if not success then return success, err; end |