mirror of
https://github.com/vastsa/FileCodeBox.git
synced 2026-11-30 04:37:50 +08:00
完善 aiosqlite 异步数据库驱动
This commit is contained in:
1 parent
e5d18a5bf3
commit
b999073da4
3 files changed
+5
-3
No files matched your search
@@ -9,6 +9,8 @@ engine = create_async_engine("sqlite+aiosqlite:///database.db")
|
||||
|
||||
Base = declarative_base()
|
||||
|
||||
Base.metadata.create_all(bind=engine)
|
||||
|
||||
|
||||
async def get_session():
|
||||
async with AsyncSession(engine, expire_on_commit=False) as s:
|
||||
|
||||
Reference in new issue
Block a user