mirror of
https://github.com/xuthus83/LittlePaimon.git
synced 2024-10-21 16:27:15 +08:00
✨ 通过猴子补丁,解决Tortoise-orm
数据库冲突问题
This commit is contained in:
parent
48ade0ff3d
commit
8f8f21993a
@ -5,6 +5,23 @@ from LittlePaimon import database, web
|
||||
from LittlePaimon.utils import DRIVER, __version__, NICKNAME, SUPERUSERS
|
||||
from LittlePaimon.utils.tool import check_resource
|
||||
|
||||
from typing import Dict, Any
|
||||
from tortoise.connection import ConnectionHandler
|
||||
|
||||
DBConfigType = Dict[str, Any]
|
||||
|
||||
|
||||
async def _init(self, db_config: "DBConfigType", create_db: bool):
|
||||
if self._db_config is None:
|
||||
self._db_config = db_config
|
||||
else:
|
||||
self._db_config.update(db_config)
|
||||
self._create_db = create_db
|
||||
await self._init_connections()
|
||||
|
||||
|
||||
ConnectionHandler._init = _init
|
||||
|
||||
logo = """<g>
|
||||
██╗ ██╗████████╗████████╗██╗ ███████╗ ██████╗ █████╗ ██╗███╗ ███╗ ██████╗ ███╗ ██╗
|
||||
██║ ██║╚══██╔══╝╚══██╔══╝██║ ██╔════╝ ██╔══██╗██╔══██╗██║████╗ ████║██╔═══██╗████╗ ██║
|
||||
|
Loading…
Reference in New Issue
Block a user