mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 20:14:36 +00:00
feat: 持久化和 web 接口基础架构
This commit is contained in:
13
pkg/persistence/databases/sqlite.py
Normal file
13
pkg/persistence/databases/sqlite.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import sqlalchemy.ext.asyncio as sqlalchemy_asyncio
|
||||
|
||||
from .. import database
|
||||
|
||||
|
||||
@database.manager_class("sqlite")
|
||||
class SQLiteDatabaseManager(database.BaseDatabaseManager):
|
||||
"""SQLite 数据库管理类"""
|
||||
|
||||
async def initialize(self) -> None:
|
||||
self.engine = sqlalchemy_asyncio.create_async_engine(f"sqlite+aiosqlite:///{self.ap.system_cfg.data['persistence']['sqlite']['path']}")
|
||||
Reference in New Issue
Block a user