0ptr/base.py

14 lines
319 B
Python
Raw Normal View History

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