"""Steward's own backups as a scheduled job: make the file, send it, record how it went (milestone 507).""" from __future__ import annotations from sqlalchemy import text from sqlalchemy.ext.asyncio import create_async_engine async def migration_heads(database_url: str) -> list[str]: """The migration revisions the database is at, for the manifest.""" engine = create_async_engine(database_url) try: async with engine.connect() as conn: return list((await conn.execute(text("SELECT version_num FROM alembic_version"))).scalars()) finally: await engine.dispose()