mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-04 22:41:12 +02:00
Use aiosqlite and add service for templates
This commit is contained in:
1 parent
d730c591b3
commit
0fea3f969e
14 files changed
+290
-230
No files matched your search
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user