tuxbot-bot/cogs/utils/database.py
Romain J 98b241d51b refactor(command|sondage): continue rewrite of sondage
known issues: more than 2 votes are not peristed
2019-10-06 23:49:00 +02:00

11 lines
311 B
Python

from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, session
class Database:
def __init__(self, config):
self.engine = create_engine(config.postgresql)
Session = sessionmaker()
Session.configure(bind=self.engine)
self.session: session = Session()