tuxbot-bot/utils/models/__init__.py
Romain J be1e6d24e4 breaking change !
update(database): change database ORM

todo: update Admin, Poll and User cogs
2020-01-15 22:56:54 +01:00

15 lines
497 B
Python

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()
from .warn import WarnModel
from .poll import PollModel, ResponsesModel
from .alias import AliasesModel