0ptr/base.py
2023-06-07 21:48:28 +02:00

14 lines
319 B
Python

from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
def get_session(fil):
fil = 'data/store.db'
engine = create_engine('sqlite:///' + fil)
Session = sessionmaker(bind=engine)
return engine, Session
Base = declarative_base()