Use aiosqlite and add service for templates

This commit is contained in:
grossmj committed 2021-03-28 21:17:29 +10:30
1 parent d730c591b3
commit 0fea3f969e
14 files changed
+290 -230

No files matched your search

+1 -1
View File
@@ -31,7 +31,7 @@ log = logging.getLogger(__name__)
async def connect_to_db(app: FastAPI) -> None:
db_path = os.path.join(Config.instance().config_dir, "gns3_controller.db")
db_url = os.environ.get("GNS3_DATABASE_URI", f"sqlite+pysqlite:///{db_path}")
db_url = os.environ.get("GNS3_DATABASE_URI", f"sqlite+aiosqlite:///{db_path}")
engine = create_async_engine(db_url, connect_args={"check_same_thread": False}, future=True)
try:
async with engine.begin() as conn: