[docs]asyncdefinit_db()->None:"""Initialize database and create all tables including new user management and queue tables."""asyncwithengine.begin()asconn:awaitconn.run_sync(Base.metadata.create_all)# Initialize default task statistics if none existfrom.operationsimportget_or_create_task_statisticsawaitget_or_create_task_statistics()
[docs]defensure_connection()->None:"""Async SQLAlchemy manages connections via the session. No-op retained for compatibility."""returnNone