aboutsummaryrefslogtreecommitdiff
path: root/wqflask/db/call.py
diff options
context:
space:
mode:
authorPjotr Prins2016-06-23 11:10:44 +0000
committerPjotr Prins2016-06-23 11:10:44 +0000
commit92d2f3f51d4191b079567f251348b316fe35feff (patch)
tree9d77956422677cc6840e1309b762debd31687a08 /wqflask/db/call.py
parenta3c32694806ffc212f987c99c20799526069d643 (diff)
downloadgenenetwork2-92d2f3f51d4191b079567f251348b316fe35feff.tar.gz
Add fetchall iterator
Diffstat (limited to 'wqflask/db/call.py')
-rw-r--r--wqflask/db/call.py12
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