AI ニジカ綜合
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
767 B

  1. from __future__ import annotations
  2. import os
  3. from typing import TypedDict
  4. from eloquent import DatabaseManager, Model
  5. CONFIG: dict[str, DbConfig] = { 'mysql': { 'driver': 'mysql',
  6. 'host': 'localhost',
  7. 'database': 'nizika_ai',
  8. 'user': os.environ['MYSQL_USER'],
  9. 'password': os.environ['MYSQL_PASS'],
  10. 'prefix': '' } }
  11. DB = DatabaseManager (CONFIG)
  12. Model.set_connection_resolver (DB)
  13. class DbConfig (TypedDict):
  14. driver: str
  15. host: str
  16. database: str
  17. user: str
  18. password: str
  19. prefix: str