mirror of
https://github.com/283375/arcaea-offline-pyside-ui.git
synced 2025-07-01 12:26:26 +00:00
wip: arcaea-offline==0.2.0
- fix imports
This commit is contained in:
11
ui/extends/shared/database.py
Normal file
11
ui/extends/shared/database.py
Normal file
@ -0,0 +1,11 @@
|
||||
from typing import Type
|
||||
|
||||
from PySide6.QtCore import QUrl
|
||||
from sqlalchemy import Engine
|
||||
from sqlalchemy import create_engine as sa_create_engine
|
||||
from sqlalchemy.pool import NullPool, Pool
|
||||
|
||||
|
||||
def create_engine(_url: str | QUrl, pool: Type[Pool] = NullPool) -> Engine:
|
||||
url = _url.toString() if isinstance(_url, QUrl) else _url
|
||||
return sa_create_engine(url, poolclass=pool)
|
Reference in New Issue
Block a user