diff options
-rw-r--r-- | wqflask/wqflask/database.py | 11 | ||||
-rw-r--r-- | wqflask/wqflask/views.py | 3 |
2 files changed, 0 insertions, 14 deletions
diff --git a/wqflask/wqflask/database.py b/wqflask/wqflask/database.py index 9f659ae6..c89216cf 100644 --- a/wqflask/wqflask/database.py +++ b/wqflask/wqflask/database.py @@ -27,17 +27,6 @@ def sql_uri(): "GN2_SETTINGS", os.path.abspath("../etc/default_settings.py")), "SQL_URI")) -engine = create_engine(sql_uri(), encoding="latin1") - -db_session = scoped_session(sessionmaker(autocommit=False, - autoflush=False, - bind=engine)) -Base = declarative_base() -Base.query = db_session.query_property() - -# Initialise the db -Base.metadata.create_all(bind=engine) - def parse_db_url(sql_uri: str) -> Tuple: """ Parse SQL_URI env variable from an sql URI diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 31e31875..1dd654df 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -98,8 +98,6 @@ from utility.benchmark import Bench from pprint import pformat as pf -from wqflask.database import db_session - import utility.logger @@ -120,7 +118,6 @@ def connect_db(): def shutdown_session(exception=None): db = getattr(g, '_database', None) if db is not None: - db_session.remove() g.db.dispose() g.db = None |