示例#1
0
def data(settings):
    from clld.db.meta import Base, DBSession, VersionedDBSession

    engine = sa.engine_from_config(settings)
    Base.metadata.create_all(bind=engine)
    DBSession.configure(bind=engine)
    VersionedDBSession.configure(bind=engine)

    yield engine

    DBSession.close()
    VersionedDBSession.close()