system_assignation/persistence/Base.py

18 lines
475 B
Python
Raw Normal View History

"""
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)