tuxbot-bot/cogs/utils/database.py

12 lines
322 B
Python
Raw Normal View History

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