2019-10-06 23:49:00 +02:00
|
|
|
from sqlalchemy import create_engine
|
|
|
|
from sqlalchemy.orm import sessionmaker, session
|
|
|
|
|
|
|
|
|
|
|
|
class Database:
|
|
|
|
def __init__(self, config):
|
2019-10-09 00:14:43 +02:00
|
|
|
self.engine = create_engine(config.postgresql, echo=True)
|
2019-10-06 23:49:00 +02:00
|
|
|
|
|
|
|
Session = sessionmaker()
|
|
|
|
Session.configure(bind=self.engine)
|
|
|
|
self.session: session = Session()
|