Changeset

5743:8363dda76155

Backed out changeset 3c57c2281087
author Kim Alvefur <zash@zash.se>
date Fri, 12 Jul 2013 17:41:54 +0200
parents 5742:3c57c2281087
children 5744:253dfea0e3f6
files util/sql.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/util/sql.lua	Fri Jul 12 17:03:09 2013 +0200
+++ b/util/sql.lua	Fri Jul 12 17:41:54 2013 +0200
@@ -178,6 +178,7 @@
 
 local result_mt = { __index = {
 	affected = function(self) return self.__affected; end;
+	rowcount = function(self) return self.__rowcount; end;
 } };
 
 function engine:execute_query(sql, ...)
@@ -199,7 +200,7 @@
 		prepared[sql] = stmt;
 	end
 	assert(stmt:execute(...));
-	return setmetatable({ __affected = stmt:affected() }, result_mt);
+	return setmetatable({ __affected = stmt:affected(), __rowcount = stmt:rowcount() }, result_mt);
 end
 engine.insert = engine.execute_update;
 engine.select = engine.execute_query;