From 6741dd52821a72564fa817de0e2cf1b979c73d5e Mon Sep 17 00:00:00 2001 From: Ryan Lerch Date: Apr 28 2016 13:11:31 +0000 Subject: changed slightly how to detect using sqlite changed how we determine id the db_url is using sqlite or not --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index 12608b2..81485d1 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -83,7 +83,7 @@ def create_session(db_url, debug=False, pool_recycle=3600): :return a Session that can be used to query the database. ''' - if db_url.partition(":")[0] == "sqlite": + if db_url.startswith('sqlite'): engine = sqlalchemy.create_engine( db_url, echo=debug, pool_recycle=pool_recycle) else: diff --git a/pagure/lib/model.py b/pagure/lib/model.py index 62287ca..5d2d006 100644 --- a/pagure/lib/model.py +++ b/pagure/lib/model.py @@ -47,8 +47,8 @@ def create_tables(db_url, alembic_ini=None, acls=None, debug=False): :return a session that can be used to query the database. """ - if db_url.partition(":")[0] == "sqlite": - engine = create_engine(db_url, echo=debug) + if db_url.startswith('sqlite'): + engine = create_engine(db_url, echo=debug) else: engine = create_engine(db_url, echo=debug, client_encoding='utf8')