commands

class advanced_alchemy.alembic.commands.AlembicSpannerImpl[source]

Bases: DefaultImpl

Alembic implementation for Spanner.

class advanced_alchemy.alembic.commands.AlembicDuckDBImpl[source]

Bases: DefaultImpl

Alembic implementation for DuckDB.

class advanced_alchemy.alembic.commands.AlembicCommandConfig[source]

Bases: Config

__init__(engine: Engine | AsyncEngine, version_table_name: str, bind_key: str | None = None, file_: str | os.PathLike[str] | None = None, ini_section: str = 'alembic', output_buffer: TextIO | None = None, stdout: TextIO = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, cmd_opts: Namespace | None = None, config_args: Mapping[str, Any] | None = None, attributes: dict[str, Any] | None = None, template_directory: Path | None = None, version_table_schema: str | None = None, render_as_batch: bool = True, compare_type: bool = False, user_module_prefix: str | None = 'sa.') None[source]

Initialize the AlembicCommandConfig.

Parameters:
  • engine (sqlalchemy.engine.Engine | sqlalchemy.ext.asyncio.AsyncEngine) – The SQLAlchemy engine instance.

  • version_table_name (str) – The name of the version table.

  • bind_key (str | None) – The bind key for the metadata.

  • file_ (str | os.PathLike[str] | None) – The file path for the alembic configuration.

  • ini_section (str) – The ini section name.

  • output_buffer (TextIO | None) – The output buffer for alembic commands.

  • stdout (TextIO) – The standard output stream.

  • cmd_opts (argparse.Namespace | None) – Command line options.

  • config_args (Mapping[str, Any] | None) – Additional configuration arguments.

  • attributes (dict[str, Any] | None) – Additional attributes for the configuration.

  • template_directory (pathlib.Path | None) – The directory for alembic templates.

  • version_table_schema (str | None) – The schema for the version table.

  • render_as_batch (bool) – Whether to render migrations as batch.

  • compare_type (bool) – Whether to compare types during migrations.

  • user_module_prefix (str | None) – The prefix for user modules.

get_template_directory() str[source]

Return the directory where Alembic setup templates are found.

This method is used by the alembic init and list_templates commands.