update 0.0.6.5

This commit is contained in:
HibiKi
2021-12-01 14:03:34 +08:00
parent 8c4b515093
commit 2a1a2ee8c5
42 changed files with 515 additions and 254 deletions
Regular → Executable
+2 -2
View File
@@ -1,2 +1,2 @@
from .db_context import *
from .log import *
from .db_context import *
from .log import *
Regular → Executable
+25 -25
View File
@@ -1,25 +1,25 @@
from gino import Gino
from .log import logger
from configs.config import bind, sql_name, user, password, address, port, database
# 全局数据库连接对象
db = Gino()
async def init():
i_bind = bind
if not i_bind:
i_bind = f"{sql_name}://{user}:{password}@{address}:{port}/{database}"
try:
await db.set_bind(i_bind)
await db.gino.create_all()
logger.info(f'Database loaded successfully!')
except Exception as e:
raise Exception(f'数据库连接错误.... e: {e}')
async def disconnect():
await db.pop_bind().close()
from gino import Gino
from .log import logger
from configs.config import bind, sql_name, user, password, address, port, database
# 全局数据库连接对象
db = Gino()
async def init():
i_bind = bind
if not i_bind:
i_bind = f"{sql_name}://{user}:{password}@{address}:{port}/{database}"
try:
await db.set_bind(i_bind)
await db.gino.create_all()
logger.info(f'Database loaded successfully!')
except Exception as e:
raise Exception(f'数据库连接错误.... e: {e}')
async def disconnect():
await db.pop_bind().close()
Regular → Executable
View File