mirror of
https://github.com/bjc/prosody.git
synced 2025-04-04 21:57:45 +03:00
util.sql: Rename some variable to match conventions
This commit is contained in:
parent
424d93cdac
commit
15e84d4ec5
1 changed files with 6 additions and 6 deletions
12
util/sql.lua
12
util/sql.lua
|
@ -163,8 +163,8 @@ engine.delete = engine.execute_update;
|
||||||
engine.update = engine.execute_update;
|
engine.update = engine.execute_update;
|
||||||
function engine:_transaction(func, ...)
|
function engine:_transaction(func, ...)
|
||||||
if not self.conn then
|
if not self.conn then
|
||||||
local a,b = self:connect();
|
local ok, err = self:connect();
|
||||||
if not a then return a,b; end
|
if not ok then return ok, err; end
|
||||||
end
|
end
|
||||||
--assert(not self.__transaction, "Recursive transactions not allowed");
|
--assert(not self.__transaction, "Recursive transactions not allowed");
|
||||||
local args, n_args = {...}, select("#", ...);
|
local args, n_args = {...}, select("#", ...);
|
||||||
|
@ -184,15 +184,15 @@ function engine:_transaction(func, ...)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function engine:transaction(...)
|
function engine:transaction(...)
|
||||||
local a,b = self:_transaction(...);
|
local ok, ret = self:_transaction(...);
|
||||||
if not a then
|
if not ok then
|
||||||
local conn = self.conn;
|
local conn = self.conn;
|
||||||
if not conn or not conn:ping() then
|
if not conn or not conn:ping() then
|
||||||
self.conn = nil;
|
self.conn = nil;
|
||||||
a,b = self:_transaction(...);
|
ok, ret = self:_transaction(...);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return a,b;
|
return ok, ret;
|
||||||
end
|
end
|
||||||
function engine:_create_index(index)
|
function engine:_create_index(index)
|
||||||
local sql = "CREATE INDEX `"..index.name.."` ON `"..index.table.."` (";
|
local sql = "CREATE INDEX `"..index.name.."` ON `"..index.table.."` (";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue