mirror of
https://github.com/xuthus83/LittlePaimon.git
synced 2025-04-12 23:29:37 +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 import DRIVER, __version__, NICKNAME, SUPERUSERS
|
||||||
from LittlePaimon.utils.tool import check_resource
|
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>
|
logo = """<g>
|
||||||
██╗ ██╗████████╗████████╗██╗ ███████╗ ██████╗ █████╗ ██╗███╗ ███╗ ██████╗ ███╗ ██╗
|
██╗ ██╗████████╗████████╗██╗ ███████╗ ██████╗ █████╗ ██╗███╗ ███╗ ██████╗ ███╗ ██╗
|
||||||
██║ ██║╚══██╔══╝╚══██╔══╝██║ ██╔════╝ ██╔══██╗██╔══██╗██║████╗ ████║██╔═══██╗████╗ ██║
|
██║ ██║╚══██╔══╝╚══██╔══╝██║ ██╔════╝ ██╔══██╗██╔══██╗██║████╗ ████║██╔═══██╗████╗ ██║
|
||||||
|
Loading…
x
Reference in New Issue
Block a user