refactor: database initialize checker

This commit is contained in:
2025-08-13 15:17:46 +08:00
parent 806acd5793
commit 06a1ca00bd
6 changed files with 80 additions and 37 deletions

View File

@ -1,14 +1,4 @@
from typing import Type
from PySide6.QtCore import QObject, QUrl, Signal
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)
from PySide6.QtCore import QObject, Signal
class DatabaseUpdateSignals(QObject):