Diff

util/sql.lua @ 6733:36e2b35397b1

util.sql: Rename some variable to match conventions
author Matthew Wild <mwild1@gmail.com>
date Wed, 03 Jun 2015 15:54:52 +0100
parent 6730:7889515bac86
child 6734:592f6112563e
line wrap: on
line diff
--- a/util/sql.lua	Wed Jun 03 15:53:27 2015 +0100
+++ b/util/sql.lua	Wed Jun 03 15:54:52 2015 +0100
@@ -163,8 +163,8 @@
 engine.update = engine.execute_update;
 function engine:_transaction(func, ...)
 	if not self.conn then
-		local a,b = self:connect();
-		if not a then return a,b; end
+		local ok, err = self:connect();
+		if not ok then return ok, err; end
 	end
 	--assert(not self.__transaction, "Recursive transactions not allowed");
 	local args, n_args = {...}, select("#", ...);
@@ -184,15 +184,15 @@
 	end
 end
 function engine:transaction(...)
-	local a,b = self:_transaction(...);
-	if not a then
+	local ok, ret = self:_transaction(...);
+	if not ok then
 		local conn = self.conn;
 		if not conn or not conn:ping() then
 			self.conn = nil;
-			a,b = self:_transaction(...);
+			ok, ret = self:_transaction(...);
 		end
 	end
-	return a,b;
+	return ok, ret;
 end
 function engine:_create_index(index)
 	local sql = "CREATE INDEX `"..index.name.."` ON `"..index.table.."` (";