diff options
Diffstat (limited to 'wqflask/db/call.py')
-rw-r--r-- | wqflask/db/call.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/wqflask/db/call.py b/wqflask/db/call.py index ac9f7fe5..4cea7e66 100644 --- a/wqflask/db/call.py +++ b/wqflask/db/call.py @@ -40,6 +40,18 @@ original fetchone, but with logging) callername = stack()[2][3] return logger.sql(callername, query, helper) +def fetchall(query): + """Return row iterator by calling SQL directly (the +original fetchall, but with logging) + + """ + with Bench("SQL",LOG_SQL): + def helper(query): + res = g.db.execute(query) + return res.fetchall() + callername = stack()[2][3] + return logger.sql(callername, query, helper) + def gn_server(path): """Return JSON record by calling GN_SERVER |