]> git.datanom.net - pwp.git/blobdiff - app/DB/base.py
Half way through migration away from sqlalchemy
[pwp.git] / app / DB / base.py
index cf3e11a941cceb56303baa026afbd96bc7e9c015..5f1d5012de7f705167c6c6f46c72dd15cb074d23 100644 (file)
@@ -1,12 +1,17 @@
+import logging
+logging.basicConfig(level=logging.INFO)
+logger = logging.getLogger(__name__)
+
 class Base(object):
 
-    def query(self, sql):
+    def query(self, sql, placeholders):
         res = None
         cur = self.conn.cursor()
         try:
-            cur.execute(sql)
+            cur.execute(sql, placeholders)
             res = cur.fetchall()
-        except:
+        except Exception as e:
+            logger.error("{0}".format(e))
             pass
         finally:
             cur.close()
This page took 0.051812 seconds and 5 git commands to generate.