INNER CODE UNIT · Python

stamp

litestar-org/advanced-alchemy · advanced_alchemy/cli.py:241

    def stamp(bind_key: Optional[str], revision: str, sql: bool, tag: Optional[str], purge: bool) -> None:  # pyright: ignore[reportUnusedFunction]
        """Stamp the revision table with the given revision."""
        from advanced_alchemy.alembic.commands import AlembicCommands

        ctx = cast("click.Context", click.get_current_context())
        console.rule("[yellow]Stamping revision table[/]", align="left")
        sqlalchemy_config = get_config_by_bind_key(ctx, bind_key)
        alembic_commands = AlembicCommands(sqlalchemy_config=sqlalchemy_config)
        alembic_commands.stamp(revision=revision, sql=sql, tag=tag, purge=purge)

    @database_group.command(
        name="check",
        help="Check if the target database is up to date",
    )
    @bind_key_option
    def check_revision(bind_key: Optional[str]) -> None:  # pyright: ignore[reportUnusedFunction]
        """Check for pending upgrade operations."""
        from advanced_alchemy.alembic.commands import AlembicCommands

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…