Open StandinKP opened 9 months ago
Managed to use it with below code:
loop = asyncio.get_event_loop()
if loop and loop.is_running():
tsk = loop.create_task(db_engine.configure_database([User]))
tsk.add_done_callback(
lambda t: print(f"Task done with result={t.result()} << return val of main()")
)
But is this the correct approach or any other way is supposed to be used?
Trying to use db_engine.configure_database([User]) but as we need to await it, it cannot be directly run without any async function declared and called. Do you need to create a factory for this?
This is my code: