|
|
@ -18,9 +18,7 @@ class MyDumbSQLStorageAdapter(SQLStorageAdapter):
|
|
|
|
if not self.database_uri:
|
|
|
|
if not self.database_uri:
|
|
|
|
self.database_uri = "sqlite:///db.sqlite3"
|
|
|
|
self.database_uri = "sqlite:///db.sqlite3"
|
|
|
|
|
|
|
|
|
|
|
|
self.engine = create_engine(
|
|
|
|
self.engine = create_engine(self.database_uri, connect_args={"check_same_thread": False})
|
|
|
|
self.database_uri, connect_args={"check_same_thread": False}
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if self.database_uri.startswith("sqlite://"):
|
|
|
|
if self.database_uri.startswith("sqlite://"):
|
|
|
|
from sqlalchemy.engine import Engine
|
|
|
|
from sqlalchemy.engine import Engine
|
|
|
@ -31,7 +29,7 @@ class MyDumbSQLStorageAdapter(SQLStorageAdapter):
|
|
|
|
dbapi_connection.execute("PRAGMA journal_mode=WAL")
|
|
|
|
dbapi_connection.execute("PRAGMA journal_mode=WAL")
|
|
|
|
dbapi_connection.execute("PRAGMA synchronous=NORMAL")
|
|
|
|
dbapi_connection.execute("PRAGMA synchronous=NORMAL")
|
|
|
|
|
|
|
|
|
|
|
|
if not inspect(self.engine).has_table('Statement'):
|
|
|
|
if not inspect(self.engine).has_table("Statement"):
|
|
|
|
self.create_database()
|
|
|
|
self.create_database()
|
|
|
|
|
|
|
|
|
|
|
|
self.Session = sessionmaker(bind=self.engine, expire_on_commit=True)
|
|
|
|
self.Session = sessionmaker(bind=self.engine, expire_on_commit=True)
|
|
|
|