aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-02-21 16:23:11 +0300
committerFrederick Muriuki Muriithi2023-02-21 16:24:30 +0300
commit90f2c1ae6c7a3321e6bc3373edbf560a21748e84 (patch)
tree7e0a88fceb7349f250001c122091bbb41cfbaa31
parenta5f83724d3075680e6d200086e3400ac938cc525 (diff)
downloadgenenetwork3-90f2c1ae6c7a3321e6bc3373edbf560a21748e84.tar.gz
auth: db: DEBUG: Output quer(y|ies) that were run.
-rw-r--r--gn3/auth/db.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/gn3/auth/db.py b/gn3/auth/db.py
index b74f341..3b1844a 100644
--- a/gn3/auth/db.py
+++ b/gn3/auth/db.py
@@ -51,6 +51,8 @@ def connection(db_path: str, row_factory: Callable = sqlite3.Row) -> Iterator[Db
"""Create the connection to the auth database."""
conn = sqlite3.connect(db_path)
conn.row_factory = row_factory
+ if app.config["DEBUG"]:
+ conn.set_trace_callback(app.logger.debug)
conn.execute("PRAGMA foreign_keys = ON")
try:
yield conn