# HG changeset patch # User Kim Alvefur # Date 1373643714 -7200 # Node ID 8363dda76155f90bfdd7b9e705d30a3f70611630 # Parent 3c57c2281087ae8d64f79dc1b5039ad7f904ba46 Backed out changeset 3c57c2281087 diff -r 3c57c2281087 -r 8363dda76155 util/sql.lua --- 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;