From 3ffc77559c269b85385350166f5392cab654c429 Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Fri, 4 Sep 2015 18:16:51 +0200 Subject: [PATCH] Make it possible to enable database query echoing Signed-off-by: Patrick Uiterwijk Reviewed-by: Rob Crittenden --- ipsilon/util/data.py | 5 ++++- templates/install/ipsilon.conf | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ipsilon/util/data.py b/ipsilon/util/data.py index 52fde62..0981c52 100644 --- a/ipsilon/util/data.py +++ b/ipsilon/util/data.py @@ -69,7 +69,10 @@ class SqlStore(BaseStore): # It's not possible to share connections for SQLite between # threads, so let's use the SingletonThreadPool for them pool_args = {'poolclass': SingletonThreadPool} - self._dbengine = create_engine(engine_name, **pool_args) + self._dbengine = create_engine(engine_name, + echo=cherrypy.config.get('db.echo', + False), + **pool_args) self.is_readonly = False def add_constraint(self, constraint): diff --git a/templates/install/ipsilon.conf b/templates/install/ipsilon.conf index f68c12a..f69ac9d 100644 --- a/templates/install/ipsilon.conf +++ b/templates/install/ipsilon.conf @@ -5,6 +5,7 @@ template_dir = "templates" cache_dir = "${cachedir}" cleanup_interval = ${cleanup_interval} db.conn.log = False +db.echo = False log.screen = ${debugging} base.mount = "/${instance}" -- 2.20.1