from __future__ import annotations import os from typing import TypedDict from eloquent import DatabaseManager, Model # type: ignore CONFIG: DBConfig = { 'default': 'nico', 'connections': { 'ai': { 'driver': 'mysql', 'host': 'localhost', 'database': 'nizika_ai', 'user': os.environ['MYSQL_USER'], 'password': os.environ['MYSQL_PASS'], 'prefix': '' }, 'nico': { 'driver': 'mysql', 'host': 'localhost', 'database': 'nizika_nico', 'user': os.environ['MYSQL_USER'], 'password': os.environ['MYSQL_PASS'], 'prefix': '' } } } DB = DatabaseManager (CONFIG) Model.set_connection_resolver (DB) class DBConfig (TypedDict): default: str connections: dict[str, DBConnection] class DBConnection (TypedDict): driver: str host: str database: str user: str password: str prefix: str