mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
something something ScopedSession?
This commit is contained in:
parent
ee1a1983c0
commit
140b46875d
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
table_objs = sqlalchemy.sql.util.sort_tables(table_objs)
|
||||||
|
|
||||||
|
session = session() # get a concrete Session from a ScopedSession
|
||||||
engine = session.get_bind()
|
engine = session.get_bind()
|
||||||
|
|
||||||
# Limit table names to 30 characters for Oracle
|
# 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
|
# SQLite speed tweaks
|
||||||
if not safe and engine.dialect.name == 'sqlite':
|
if not safe and engine.dialect.name == 'sqlite':
|
||||||
session.execute("PRAGMA synchronous=OFF")
|
session.execute("PRAGMA synchronous=OFF")
|
||||||
#session.execute("PRAGMA journal_mode=OFF")
|
session.execute("PRAGMA journal_mode=OFF")
|
||||||
|
|
||||||
# Drop all tables if requested
|
# Drop all tables if requested
|
||||||
if drop_tables:
|
if drop_tables:
|
||||||
|
|
Loading…
Reference in a new issue