14 lines
319 B
Python
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()
|