diff options
author | Kim Alvefur <zash@zash.se> | 2013-07-12 17:41:54 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2013-07-12 17:41:54 +0200 |
commit | afbae0fd76e9dfde06a1834dcc22f8c93de3c4d4 (patch) | |
tree | bb7bac60aef4104bdef44dc7d2e278b59137979b /util/sql.lua | |
parent | 6b8541cacae8dd606883c94d66433e5e25f1b219 (diff) | |
download | prosody-afbae0fd76e9dfde06a1834dcc22f8c93de3c4d4.tar.gz prosody-afbae0fd76e9dfde06a1834dcc22f8c93de3c4d4.zip |
Backed out changeset 3c57c2281087
Diffstat (limited to 'util/sql.lua')
-rw-r--r-- | util/sql.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/util/sql.lua b/util/sql.lua index 475215bb..771df7aa 100644 --- a/util/sql.lua +++ b/util/sql.lua @@ -178,6 +178,7 @@ end 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 @@ function engine:execute_update(sql, ...) 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; |