I have function that execute all functions in list like
async def db_create():
x = [users_table_create, element_table_create]
async with pool.acquire() as con:
async for creation_func in x:
async with con.transaction() as tr:
try:
await creation_func(con)
await tr.commit()
except Exception:
tr.rollback()
funcs:
async def elements_table_create(con) -> NoReturn:
await con.execute("CREATE TABLE elements(...);")
async def users_table_create(con) -> NoReturn:
await con.execute("CREATE TABLE users(...);")
But I got exception that I need something with __aiter__
, not list