def delete(instance): with scoped_session() as db: db.delete(instance)
def add(instance): with scoped_session() as db: db.add(instance)
def add_all(instances): with scoped_session() as db: db.add_all(instances)
def merge(instance, load=True): with scoped_session() as db: db.merge(instance, load=load)