tuxbot-bot/utils/models/__init__.py

19 lines
579 B
Python
Raw Permalink Normal View History

import databases
import sqlalchemy
from utils.functions import Config
conf_postgresql = Config('./configs/config.cfg')["postgresql"]
postgresql = 'postgresql://{}:{}@{}/{}'.format(
conf_postgresql.get("Username"), conf_postgresql.get("Password"),
conf_postgresql.get("Host"), conf_postgresql.get("DBName"))
database = databases.Database(postgresql)
metadata = sqlalchemy.MetaData()
2019-12-16 18:12:10 +01:00
2020-02-04 18:47:11 +01:00
engine = sqlalchemy.create_engine(str(database.url))
metadata.create_all(engine)
2019-12-30 00:48:11 +01:00
from .warn import WarnModel
from .poll import PollModel, ResponsesModel
from .alias import AliasesModel