def wipe_storage(mysql_url): engine = create_engine(mysql_url, isolation_level="AUTOCOMMIT", poolclass=db.pool.NullPool) try: ScheduleStorageSqlMetadata.drop_all(engine) finally: engine.dispose()
def create_clean_storage(postgres_url, should_autocreate_tables=True): engine = create_engine(postgres_url, isolation_level="AUTOCOMMIT", poolclass=db.pool.NullPool) try: ScheduleStorageSqlMetadata.drop_all(engine) finally: engine.dispose() return PostgresScheduleStorage(postgres_url, should_autocreate_tables)
def create_clean_storage(postgres_url): engine = create_engine(postgres_url, isolation_level='AUTOCOMMIT', poolclass=db.pool.NullPool) try: ScheduleStorageSqlMetadata.drop_all(engine) finally: engine.dispose() return PostgresScheduleStorage(postgres_url)