From 140b46875d620942cd2faf837205a1cc184d00c2 Mon Sep 17 00:00:00 2001 From: Andrew Ekstedt Date: Fri, 30 Mar 2018 14:08:10 -0700 Subject: [PATCH] something something ScopedSession? --- pokedex/db/load.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pokedex/db/load.py b/pokedex/db/load.py index 1684bbf..4e1748a 100644 --- a/pokedex/db/load.py +++ b/pokedex/db/load.py @@ -147,6 +147,7 @@ def load(session, tables=[], directory=None, drop_tables=False, verbose=False, s table_objs = sqlalchemy.sql.util.sort_tables(table_objs) + session = session() # get a concrete Session from a ScopedSession engine = session.get_bind() # Limit table names to 30 characters for Oracle @@ -157,7 +158,7 @@ def load(session, tables=[], directory=None, drop_tables=False, verbose=False, s # SQLite speed tweaks if not safe and engine.dialect.name == 'sqlite': session.execute("PRAGMA synchronous=OFF") - #session.execute("PRAGMA journal_mode=OFF") + session.execute("PRAGMA journal_mode=OFF") # Drop all tables if requested if drop_tables: