energy_system_modelling_wor.../persistence/Base.py
2022-11-03 15:29:09 -04:00

18 lines
475 B
Python

"""
Base repository class to establish db connection
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Peter Yefi peteryefi@gmail.com
"""
from persistence.db_config import BaseConfiguration
from sqlalchemy import create_engine
from sqlalchemy.orm import Session
class BaseRepo:
def __init__(self):
config = BaseConfiguration()
engine = create_engine(config.conn_string())
self.session = Session(engine)