alembic-pg-autogen ================== Alembic autogenerate extension for PostgreSQL functions and triggers. `GitHub `_ | `PyPI `_ If you've been manually writing ``op.execute()`` calls every time you add or change a PL/pgSQL function, this package automates that: declare your DDL strings and let ``alembic revision --autogenerate`` figure out the ``CREATE``, ``DROP``, and ``CREATE OR REPLACE`` for you. .. toctree:: :maxdepth: 2 :caption: Contents quickstart migrating api LLM-friendly documentation -------------------------- This documentation is also available in plain-text formats designed for large language models: - `llms.txt `_ — concise overview with links to each page - `llms-full.txt `_ — complete documentation in a single file See `llmstxt.org `_ for more about the ``llms.txt`` standard. Indices and tables ------------------ * :ref:`genindex` * :ref:`search` Quick start =========== Installation ------------ .. code-block:: bash pip install alembic-pg-autogen Requires Python 3.10+ and SQLAlchemy 2.x. Bring your own PostgreSQL driver (``psycopg``, ``psycopg2``, ``asyncpg``, etc.). 1. Declare your DDL ------------------- In your ``env.py`` (or a separate module), define the functions and triggers you want managed: .. code-block:: python PG_FUNCTIONS = [ """ CREATE OR REPLACE FUNCTION audit_trigger_func() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN NEW.updated_at = now(); RETURN NEW; END; $$ """, ] PG_TRIGGERS = [ """ CREATE TRIGGER set_updated_at BEFORE UPDATE ON my_table FOR EACH ROW EXECUTE FUNCTION audit_trigger_func() """, ] 2. Wire it into ``env.py`` -------------------------- Import the package (this registers the Alembic comparator plugin), then in your ``run_migrations_online()`` function pass them as keyword arguments to ``context.configure()``: .. code-block:: python import alembic_pg_autogen # noqa: F401 # registers the comparator plugin # ... in run_migrations_online(): context.configure( connection=connection, target_metadata=target_metadata, autogenerate_plugins=["alembic.autogenerate.*", "alembic_pg_autogen.*"], pg_functions=PG_FUNCTIONS, pg_triggers=PG_TRIGGERS, ) 3. Autogenerate as usual ------------------------ .. code-block:: bash alembic revision --autogenerate -m "add audit trigger" 4. Generated migration ---------------------- The migration file will contain ``op.execute()`` calls with no custom op imports needed: .. code-block:: python def upgrade() -> None: op.execute("""CREATE OR REPLACE FUNCTION public.audit_trigger_func() RETURNS trigger LANGUAGE plpgsql AS $function$ BEGIN NEW.updated_at = now(); RETURN NEW; END; $function$""") op.execute("""CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.my_table FOR EACH ROW EXECUTE FUNCTION audit_trigger_func()""") def downgrade() -> None: op.execute("DROP TRIGGER set_updated_at ON public.my_table") op.execute("DROP FUNCTION public.audit_trigger_func()") Note that the ``upgrade`` DDL is the **canonical** form read back from PostgreSQL's catalog, not a copy of your input. This means formatting will differ from what you wrote, but the semantics are identical. Migrating from alembic_utils ============================ If you're coming from `alembic_utils `_, you can pass your existing ``PGFunction`` / ``PGTrigger`` objects directly. Any object with a ``to_sql_statement_create()`` method is accepted alongside plain DDL strings: .. code-block:: python from alembic_utils.pg_function import PGFunction my_func = PGFunction(schema="public", signature="my_func()", definition="...") PG_FUNCTIONS = [ my_func, # alembic_utils object, works as-is "CREATE FUNCTION new_func() ...", # plain DDL string, also works ] This lets you migrate incrementally without rewriting all your declarations at once. API reference ============= .. toctree:: :titlesonly: apidocs/index API Reference ============= This page contains auto-generated API reference documentation [#f1]_. .. toctree:: :titlesonly: alembic_pg_autogen/alembic_pg_autogen .. [#f1] Created with `sphinx-autodoc2 `_ :py:mod:`alembic_pg_autogen` ============================ .. py:module:: alembic_pg_autogen .. autodoc2-docstring:: alembic_pg_autogen :allowtitles: Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 alembic_pg_autogen.canonicalize alembic_pg_autogen.ops alembic_pg_autogen.diff alembic_pg_autogen.render alembic_pg_autogen.inspect alembic_pg_autogen.compare Package Contents ---------------- Data ~~~~ .. list-table:: :class: autosummary longtable :align: left * - :py:obj:`__all__ ` - .. autodoc2-docstring:: alembic_pg_autogen.__all__ :summary: API ~~~ .. py:data:: __all__ :canonical: alembic_pg_autogen.__all__ :type: typing.Final[collections.abc.Sequence[str]] :value: ['Action', 'CanonicalState', 'CreateFunctionOp', 'CreateTriggerOp', 'CreateViewOp', 'DiffResult', 'D... .. autodoc2-docstring:: alembic_pg_autogen.__all__ :py:mod:`alembic_pg_autogen.canonicalize` ========================================= .. py:module:: alembic_pg_autogen.canonicalize .. autodoc2-docstring:: alembic_pg_autogen.canonicalize :allowtitles: Module Contents --------------- Classes ~~~~~~~ .. list-table:: :class: autosummary longtable :align: left * - :py:obj:`CanonicalState ` - .. autodoc2-docstring:: alembic_pg_autogen.canonicalize.CanonicalState :summary: Functions ~~~~~~~~~ .. list-table:: :class: autosummary longtable :align: left * - :py:obj:`canonicalize ` - .. autodoc2-docstring:: alembic_pg_autogen.canonicalize.canonicalize :summary: * - :py:obj:`canonicalize_functions ` - .. autodoc2-docstring:: alembic_pg_autogen.canonicalize.canonicalize_functions :summary: * - :py:obj:`canonicalize_triggers ` - .. autodoc2-docstring:: alembic_pg_autogen.canonicalize.canonicalize_triggers :summary: * - :py:obj:`canonicalize_views ` - .. autodoc2-docstring:: alembic_pg_autogen.canonicalize.canonicalize_views :summary: Data ~~~~ .. list-table:: :class: autosummary longtable :align: left * - :py:obj:`log ` - .. autodoc2-docstring:: alembic_pg_autogen.canonicalize.log :summary: API ~~~ .. py:data:: log :canonical: alembic_pg_autogen.canonicalize.log :value: 'getLogger(...)' .. autodoc2-docstring:: alembic_pg_autogen.canonicalize.log .. py:class:: CanonicalState :canonical: alembic_pg_autogen.canonicalize.CanonicalState Bases: :py:obj:`typing.NamedTuple` .. autodoc2-docstring:: alembic_pg_autogen.canonicalize.CanonicalState .. py:attribute:: functions :canonical: alembic_pg_autogen.canonicalize.CanonicalState.functions :type: collections.abc.Sequence[alembic_pg_autogen.inspect.FunctionInfo] :value: None .. autodoc2-docstring:: alembic_pg_autogen.canonicalize.CanonicalState.functions .. py:attribute:: triggers :canonical: alembic_pg_autogen.canonicalize.CanonicalState.triggers :type: collections.abc.Sequence[alembic_pg_autogen.inspect.TriggerInfo] :value: None .. autodoc2-docstring:: alembic_pg_autogen.canonicalize.CanonicalState.triggers .. py:attribute:: views :canonical: alembic_pg_autogen.canonicalize.CanonicalState.views :type: collections.abc.Sequence[alembic_pg_autogen.inspect.ViewInfo] :value: () .. autodoc2-docstring:: alembic_pg_autogen.canonicalize.CanonicalState.views .. py:function:: canonicalize(conn: sqlalchemy.Connection, *, function_ddl: collections.abc.Sequence[str] = (), view_ddl: collections.abc.Sequence[str] = (), trigger_ddl: collections.abc.Sequence[str] = (), schemas: collections.abc.Sequence[str] | None = None) -> alembic_pg_autogen.canonicalize.CanonicalState :canonical: alembic_pg_autogen.canonicalize.canonicalize .. autodoc2-docstring:: alembic_pg_autogen.canonicalize.canonicalize .. py:function:: canonicalize_functions(conn: sqlalchemy.Connection, ddl: collections.abc.Sequence[str], schemas: collections.abc.Sequence[str] | None = None) -> collections.abc.Sequence[alembic_pg_autogen.inspect.FunctionInfo] :canonical: alembic_pg_autogen.canonicalize.canonicalize_functions .. autodoc2-docstring:: alembic_pg_autogen.canonicalize.canonicalize_functions .. py:function:: canonicalize_triggers(conn: sqlalchemy.Connection, ddl: collections.abc.Sequence[str], schemas: collections.abc.Sequence[str] | None = None) -> collections.abc.Sequence[alembic_pg_autogen.inspect.TriggerInfo] :canonical: alembic_pg_autogen.canonicalize.canonicalize_triggers .. autodoc2-docstring:: alembic_pg_autogen.canonicalize.canonicalize_triggers .. py:function:: canonicalize_views(conn: sqlalchemy.Connection, ddl: collections.abc.Sequence[str], schemas: collections.abc.Sequence[str] | None = None) -> collections.abc.Sequence[alembic_pg_autogen.inspect.ViewInfo] :canonical: alembic_pg_autogen.canonicalize.canonicalize_views .. autodoc2-docstring:: alembic_pg_autogen.canonicalize.canonicalize_views :py:mod:`alembic_pg_autogen.ops` ================================ .. py:module:: alembic_pg_autogen.ops .. autodoc2-docstring:: alembic_pg_autogen.ops :allowtitles: Module Contents --------------- Classes ~~~~~~~ .. list-table:: :class: autosummary longtable :align: left * - :py:obj:`CreateFunctionOp ` - .. autodoc2-docstring:: alembic_pg_autogen.ops.CreateFunctionOp :summary: * - :py:obj:`ReplaceFunctionOp ` - .. autodoc2-docstring:: alembic_pg_autogen.ops.ReplaceFunctionOp :summary: * - :py:obj:`DropFunctionOp ` - .. autodoc2-docstring:: alembic_pg_autogen.ops.DropFunctionOp :summary: * - :py:obj:`CreateTriggerOp ` - .. autodoc2-docstring:: alembic_pg_autogen.ops.CreateTriggerOp :summary: * - :py:obj:`ReplaceTriggerOp ` - .. autodoc2-docstring:: alembic_pg_autogen.ops.ReplaceTriggerOp :summary: * - :py:obj:`DropTriggerOp ` - .. autodoc2-docstring:: alembic_pg_autogen.ops.DropTriggerOp :summary: * - :py:obj:`CreateViewOp ` - .. autodoc2-docstring:: alembic_pg_autogen.ops.CreateViewOp :summary: * - :py:obj:`ReplaceViewOp ` - .. autodoc2-docstring:: alembic_pg_autogen.ops.ReplaceViewOp :summary: * - :py:obj:`DropViewOp ` - .. autodoc2-docstring:: alembic_pg_autogen.ops.DropViewOp :summary: API ~~~ .. py:class:: CreateFunctionOp(desired: alembic_pg_autogen.inspect.FunctionInfo) :canonical: alembic_pg_autogen.ops.CreateFunctionOp Bases: :py:obj:`alembic.operations.ops.MigrateOperation` .. autodoc2-docstring:: alembic_pg_autogen.ops.CreateFunctionOp .. rubric:: Initialization .. autodoc2-docstring:: alembic_pg_autogen.ops.CreateFunctionOp.__init__ .. py:attribute:: desired :canonical: alembic_pg_autogen.ops.CreateFunctionOp.desired :type: alembic_pg_autogen.inspect.FunctionInfo :value: None .. autodoc2-docstring:: alembic_pg_autogen.ops.CreateFunctionOp.desired .. py:method:: reverse() -> alembic_pg_autogen.ops.DropFunctionOp :canonical: alembic_pg_autogen.ops.CreateFunctionOp.reverse .. autodoc2-docstring:: alembic_pg_autogen.ops.CreateFunctionOp.reverse .. py:method:: to_diff_tuple() -> tuple[str, str, str, str] :canonical: alembic_pg_autogen.ops.CreateFunctionOp.to_diff_tuple .. autodoc2-docstring:: alembic_pg_autogen.ops.CreateFunctionOp.to_diff_tuple .. py:class:: ReplaceFunctionOp(current: alembic_pg_autogen.inspect.FunctionInfo, desired: alembic_pg_autogen.inspect.FunctionInfo) :canonical: alembic_pg_autogen.ops.ReplaceFunctionOp Bases: :py:obj:`alembic.operations.ops.MigrateOperation` .. autodoc2-docstring:: alembic_pg_autogen.ops.ReplaceFunctionOp .. rubric:: Initialization .. autodoc2-docstring:: alembic_pg_autogen.ops.ReplaceFunctionOp.__init__ .. py:attribute:: current :canonical: alembic_pg_autogen.ops.ReplaceFunctionOp.current :type: alembic_pg_autogen.inspect.FunctionInfo :value: None .. autodoc2-docstring:: alembic_pg_autogen.ops.ReplaceFunctionOp.current .. py:attribute:: desired :canonical: alembic_pg_autogen.ops.ReplaceFunctionOp.desired :type: alembic_pg_autogen.inspect.FunctionInfo :value: None .. autodoc2-docstring:: alembic_pg_autogen.ops.ReplaceFunctionOp.desired .. py:method:: reverse() -> alembic_pg_autogen.ops.ReplaceFunctionOp :canonical: alembic_pg_autogen.ops.ReplaceFunctionOp.reverse .. autodoc2-docstring:: alembic_pg_autogen.ops.ReplaceFunctionOp.reverse .. py:method:: to_diff_tuple() -> tuple[str, str, str, str] :canonical: alembic_pg_autogen.ops.ReplaceFunctionOp.to_diff_tuple .. autodoc2-docstring:: alembic_pg_autogen.ops.ReplaceFunctionOp.to_diff_tuple .. py:class:: DropFunctionOp(current: alembic_pg_autogen.inspect.FunctionInfo) :canonical: alembic_pg_autogen.ops.DropFunctionOp Bases: :py:obj:`alembic.operations.ops.MigrateOperation` .. autodoc2-docstring:: alembic_pg_autogen.ops.DropFunctionOp .. rubric:: Initialization .. autodoc2-docstring:: alembic_pg_autogen.ops.DropFunctionOp.__init__ .. py:attribute:: current :canonical: alembic_pg_autogen.ops.DropFunctionOp.current :type: alembic_pg_autogen.inspect.FunctionInfo :value: None .. autodoc2-docstring:: alembic_pg_autogen.ops.DropFunctionOp.current .. py:method:: reverse() -> alembic_pg_autogen.ops.CreateFunctionOp :canonical: alembic_pg_autogen.ops.DropFunctionOp.reverse .. autodoc2-docstring:: alembic_pg_autogen.ops.DropFunctionOp.reverse .. py:method:: to_diff_tuple() -> tuple[str, str, str, str] :canonical: alembic_pg_autogen.ops.DropFunctionOp.to_diff_tuple .. autodoc2-docstring:: alembic_pg_autogen.ops.DropFunctionOp.to_diff_tuple .. py:class:: CreateTriggerOp(desired: alembic_pg_autogen.inspect.TriggerInfo) :canonical: alembic_pg_autogen.ops.CreateTriggerOp Bases: :py:obj:`alembic.operations.ops.MigrateOperation` .. autodoc2-docstring:: alembic_pg_autogen.ops.CreateTriggerOp .. rubric:: Initialization .. autodoc2-docstring:: alembic_pg_autogen.ops.CreateTriggerOp.__init__ .. py:attribute:: desired :canonical: alembic_pg_autogen.ops.CreateTriggerOp.desired :type: alembic_pg_autogen.inspect.TriggerInfo :value: None .. autodoc2-docstring:: alembic_pg_autogen.ops.CreateTriggerOp.desired .. py:method:: reverse() -> alembic_pg_autogen.ops.DropTriggerOp :canonical: alembic_pg_autogen.ops.CreateTriggerOp.reverse .. autodoc2-docstring:: alembic_pg_autogen.ops.CreateTriggerOp.reverse .. py:method:: to_diff_tuple() -> tuple[str, str, str, str] :canonical: alembic_pg_autogen.ops.CreateTriggerOp.to_diff_tuple .. autodoc2-docstring:: alembic_pg_autogen.ops.CreateTriggerOp.to_diff_tuple .. py:class:: ReplaceTriggerOp(current: alembic_pg_autogen.inspect.TriggerInfo, desired: alembic_pg_autogen.inspect.TriggerInfo) :canonical: alembic_pg_autogen.ops.ReplaceTriggerOp Bases: :py:obj:`alembic.operations.ops.MigrateOperation` .. autodoc2-docstring:: alembic_pg_autogen.ops.ReplaceTriggerOp .. rubric:: Initialization .. autodoc2-docstring:: alembic_pg_autogen.ops.ReplaceTriggerOp.__init__ .. py:attribute:: current :canonical: alembic_pg_autogen.ops.ReplaceTriggerOp.current :type: alembic_pg_autogen.inspect.TriggerInfo :value: None .. autodoc2-docstring:: alembic_pg_autogen.ops.ReplaceTriggerOp.current .. py:attribute:: desired :canonical: alembic_pg_autogen.ops.ReplaceTriggerOp.desired :type: alembic_pg_autogen.inspect.TriggerInfo :value: None .. autodoc2-docstring:: alembic_pg_autogen.ops.ReplaceTriggerOp.desired .. py:method:: reverse() -> alembic_pg_autogen.ops.ReplaceTriggerOp :canonical: alembic_pg_autogen.ops.ReplaceTriggerOp.reverse .. autodoc2-docstring:: alembic_pg_autogen.ops.ReplaceTriggerOp.reverse .. py:method:: to_diff_tuple() -> tuple[str, str, str, str] :canonical: alembic_pg_autogen.ops.ReplaceTriggerOp.to_diff_tuple .. autodoc2-docstring:: alembic_pg_autogen.ops.ReplaceTriggerOp.to_diff_tuple .. py:class:: DropTriggerOp(current: alembic_pg_autogen.inspect.TriggerInfo) :canonical: alembic_pg_autogen.ops.DropTriggerOp Bases: :py:obj:`alembic.operations.ops.MigrateOperation` .. autodoc2-docstring:: alembic_pg_autogen.ops.DropTriggerOp .. rubric:: Initialization .. autodoc2-docstring:: alembic_pg_autogen.ops.DropTriggerOp.__init__ .. py:attribute:: current :canonical: alembic_pg_autogen.ops.DropTriggerOp.current :type: alembic_pg_autogen.inspect.TriggerInfo :value: None .. autodoc2-docstring:: alembic_pg_autogen.ops.DropTriggerOp.current .. py:method:: reverse() -> alembic_pg_autogen.ops.CreateTriggerOp :canonical: alembic_pg_autogen.ops.DropTriggerOp.reverse .. autodoc2-docstring:: alembic_pg_autogen.ops.DropTriggerOp.reverse .. py:method:: to_diff_tuple() -> tuple[str, str, str, str] :canonical: alembic_pg_autogen.ops.DropTriggerOp.to_diff_tuple .. autodoc2-docstring:: alembic_pg_autogen.ops.DropTriggerOp.to_diff_tuple .. py:class:: CreateViewOp(desired: alembic_pg_autogen.inspect.ViewInfo) :canonical: alembic_pg_autogen.ops.CreateViewOp Bases: :py:obj:`alembic.operations.ops.MigrateOperation` .. autodoc2-docstring:: alembic_pg_autogen.ops.CreateViewOp .. rubric:: Initialization .. autodoc2-docstring:: alembic_pg_autogen.ops.CreateViewOp.__init__ .. py:attribute:: desired :canonical: alembic_pg_autogen.ops.CreateViewOp.desired :type: alembic_pg_autogen.inspect.ViewInfo :value: None .. autodoc2-docstring:: alembic_pg_autogen.ops.CreateViewOp.desired .. py:method:: reverse() -> alembic_pg_autogen.ops.DropViewOp :canonical: alembic_pg_autogen.ops.CreateViewOp.reverse .. autodoc2-docstring:: alembic_pg_autogen.ops.CreateViewOp.reverse .. py:method:: to_diff_tuple() -> tuple[str, str, str] :canonical: alembic_pg_autogen.ops.CreateViewOp.to_diff_tuple .. autodoc2-docstring:: alembic_pg_autogen.ops.CreateViewOp.to_diff_tuple .. py:class:: ReplaceViewOp(current: alembic_pg_autogen.inspect.ViewInfo, desired: alembic_pg_autogen.inspect.ViewInfo) :canonical: alembic_pg_autogen.ops.ReplaceViewOp Bases: :py:obj:`alembic.operations.ops.MigrateOperation` .. autodoc2-docstring:: alembic_pg_autogen.ops.ReplaceViewOp .. rubric:: Initialization .. autodoc2-docstring:: alembic_pg_autogen.ops.ReplaceViewOp.__init__ .. py:attribute:: current :canonical: alembic_pg_autogen.ops.ReplaceViewOp.current :type: alembic_pg_autogen.inspect.ViewInfo :value: None .. autodoc2-docstring:: alembic_pg_autogen.ops.ReplaceViewOp.current .. py:attribute:: desired :canonical: alembic_pg_autogen.ops.ReplaceViewOp.desired :type: alembic_pg_autogen.inspect.ViewInfo :value: None .. autodoc2-docstring:: alembic_pg_autogen.ops.ReplaceViewOp.desired .. py:method:: reverse() -> alembic_pg_autogen.ops.ReplaceViewOp :canonical: alembic_pg_autogen.ops.ReplaceViewOp.reverse .. autodoc2-docstring:: alembic_pg_autogen.ops.ReplaceViewOp.reverse .. py:method:: to_diff_tuple() -> tuple[str, str, str] :canonical: alembic_pg_autogen.ops.ReplaceViewOp.to_diff_tuple .. autodoc2-docstring:: alembic_pg_autogen.ops.ReplaceViewOp.to_diff_tuple .. py:class:: DropViewOp(current: alembic_pg_autogen.inspect.ViewInfo) :canonical: alembic_pg_autogen.ops.DropViewOp Bases: :py:obj:`alembic.operations.ops.MigrateOperation` .. autodoc2-docstring:: alembic_pg_autogen.ops.DropViewOp .. rubric:: Initialization .. autodoc2-docstring:: alembic_pg_autogen.ops.DropViewOp.__init__ .. py:attribute:: current :canonical: alembic_pg_autogen.ops.DropViewOp.current :type: alembic_pg_autogen.inspect.ViewInfo :value: None .. autodoc2-docstring:: alembic_pg_autogen.ops.DropViewOp.current .. py:method:: reverse() -> alembic_pg_autogen.ops.CreateViewOp :canonical: alembic_pg_autogen.ops.DropViewOp.reverse .. autodoc2-docstring:: alembic_pg_autogen.ops.DropViewOp.reverse .. py:method:: to_diff_tuple() -> tuple[str, str, str] :canonical: alembic_pg_autogen.ops.DropViewOp.to_diff_tuple .. autodoc2-docstring:: alembic_pg_autogen.ops.DropViewOp.to_diff_tuple :py:mod:`alembic_pg_autogen.diff` ================================= .. py:module:: alembic_pg_autogen.diff .. autodoc2-docstring:: alembic_pg_autogen.diff :allowtitles: Module Contents --------------- Classes ~~~~~~~ .. list-table:: :class: autosummary longtable :align: left * - :py:obj:`Action ` - .. autodoc2-docstring:: alembic_pg_autogen.diff.Action :summary: * - :py:obj:`FunctionOp ` - .. autodoc2-docstring:: alembic_pg_autogen.diff.FunctionOp :summary: * - :py:obj:`TriggerOp ` - .. autodoc2-docstring:: alembic_pg_autogen.diff.TriggerOp :summary: * - :py:obj:`ViewOp ` - .. autodoc2-docstring:: alembic_pg_autogen.diff.ViewOp :summary: * - :py:obj:`DiffResult ` - .. autodoc2-docstring:: alembic_pg_autogen.diff.DiffResult :summary: Functions ~~~~~~~~~ .. list-table:: :class: autosummary longtable :align: left * - :py:obj:`diff ` - .. autodoc2-docstring:: alembic_pg_autogen.diff.diff :summary: * - :py:obj:`_diff_items ` - .. autodoc2-docstring:: alembic_pg_autogen.diff._diff_items :summary: Data ~~~~ .. list-table:: :class: autosummary longtable :align: left * - :py:obj:`log ` - .. autodoc2-docstring:: alembic_pg_autogen.diff.log :summary: * - :py:obj:`_InfoT ` - .. autodoc2-docstring:: alembic_pg_autogen.diff._InfoT :summary: * - :py:obj:`_OpT ` - .. autodoc2-docstring:: alembic_pg_autogen.diff._OpT :summary: API ~~~ .. py:data:: log :canonical: alembic_pg_autogen.diff.log :value: 'getLogger(...)' .. autodoc2-docstring:: alembic_pg_autogen.diff.log .. py:class:: Action(*args, **kwds) :canonical: alembic_pg_autogen.diff.Action Bases: :py:obj:`enum.Enum` .. autodoc2-docstring:: alembic_pg_autogen.diff.Action .. rubric:: Initialization .. autodoc2-docstring:: alembic_pg_autogen.diff.Action.__init__ .. py:attribute:: CREATE :canonical: alembic_pg_autogen.diff.Action.CREATE :value: 'create' .. autodoc2-docstring:: alembic_pg_autogen.diff.Action.CREATE .. py:attribute:: REPLACE :canonical: alembic_pg_autogen.diff.Action.REPLACE :value: 'replace' .. autodoc2-docstring:: alembic_pg_autogen.diff.Action.REPLACE .. py:attribute:: DROP :canonical: alembic_pg_autogen.diff.Action.DROP :value: 'drop' .. autodoc2-docstring:: alembic_pg_autogen.diff.Action.DROP .. py:class:: FunctionOp :canonical: alembic_pg_autogen.diff.FunctionOp Bases: :py:obj:`typing.NamedTuple` .. autodoc2-docstring:: alembic_pg_autogen.diff.FunctionOp .. py:attribute:: action :canonical: alembic_pg_autogen.diff.FunctionOp.action :type: alembic_pg_autogen.diff.Action :value: None .. autodoc2-docstring:: alembic_pg_autogen.diff.FunctionOp.action .. py:attribute:: current :canonical: alembic_pg_autogen.diff.FunctionOp.current :type: alembic_pg_autogen.inspect.FunctionInfo | None :value: None .. autodoc2-docstring:: alembic_pg_autogen.diff.FunctionOp.current .. py:attribute:: desired :canonical: alembic_pg_autogen.diff.FunctionOp.desired :type: alembic_pg_autogen.inspect.FunctionInfo | None :value: None .. autodoc2-docstring:: alembic_pg_autogen.diff.FunctionOp.desired .. py:class:: TriggerOp :canonical: alembic_pg_autogen.diff.TriggerOp Bases: :py:obj:`typing.NamedTuple` .. autodoc2-docstring:: alembic_pg_autogen.diff.TriggerOp .. py:attribute:: action :canonical: alembic_pg_autogen.diff.TriggerOp.action :type: alembic_pg_autogen.diff.Action :value: None .. autodoc2-docstring:: alembic_pg_autogen.diff.TriggerOp.action .. py:attribute:: current :canonical: alembic_pg_autogen.diff.TriggerOp.current :type: alembic_pg_autogen.inspect.TriggerInfo | None :value: None .. autodoc2-docstring:: alembic_pg_autogen.diff.TriggerOp.current .. py:attribute:: desired :canonical: alembic_pg_autogen.diff.TriggerOp.desired :type: alembic_pg_autogen.inspect.TriggerInfo | None :value: None .. autodoc2-docstring:: alembic_pg_autogen.diff.TriggerOp.desired .. py:class:: ViewOp :canonical: alembic_pg_autogen.diff.ViewOp Bases: :py:obj:`typing.NamedTuple` .. autodoc2-docstring:: alembic_pg_autogen.diff.ViewOp .. py:attribute:: action :canonical: alembic_pg_autogen.diff.ViewOp.action :type: alembic_pg_autogen.diff.Action :value: None .. autodoc2-docstring:: alembic_pg_autogen.diff.ViewOp.action .. py:attribute:: current :canonical: alembic_pg_autogen.diff.ViewOp.current :type: alembic_pg_autogen.inspect.ViewInfo | None :value: None .. autodoc2-docstring:: alembic_pg_autogen.diff.ViewOp.current .. py:attribute:: desired :canonical: alembic_pg_autogen.diff.ViewOp.desired :type: alembic_pg_autogen.inspect.ViewInfo | None :value: None .. autodoc2-docstring:: alembic_pg_autogen.diff.ViewOp.desired .. py:class:: DiffResult :canonical: alembic_pg_autogen.diff.DiffResult Bases: :py:obj:`typing.NamedTuple` .. autodoc2-docstring:: alembic_pg_autogen.diff.DiffResult .. py:attribute:: function_ops :canonical: alembic_pg_autogen.diff.DiffResult.function_ops :type: collections.abc.Sequence[alembic_pg_autogen.diff.FunctionOp] :value: None .. autodoc2-docstring:: alembic_pg_autogen.diff.DiffResult.function_ops .. py:attribute:: trigger_ops :canonical: alembic_pg_autogen.diff.DiffResult.trigger_ops :type: collections.abc.Sequence[alembic_pg_autogen.diff.TriggerOp] :value: None .. autodoc2-docstring:: alembic_pg_autogen.diff.DiffResult.trigger_ops .. py:attribute:: view_ops :canonical: alembic_pg_autogen.diff.DiffResult.view_ops :type: collections.abc.Sequence[alembic_pg_autogen.diff.ViewOp] :value: () .. autodoc2-docstring:: alembic_pg_autogen.diff.DiffResult.view_ops .. py:data:: _InfoT :canonical: alembic_pg_autogen.diff._InfoT :value: 'TypeVar(...)' .. autodoc2-docstring:: alembic_pg_autogen.diff._InfoT .. py:data:: _OpT :canonical: alembic_pg_autogen.diff._OpT :value: 'TypeVar(...)' .. autodoc2-docstring:: alembic_pg_autogen.diff._OpT .. py:function:: diff(current: alembic_pg_autogen.canonicalize.CanonicalState, desired: alembic_pg_autogen.canonicalize.CanonicalState) -> alembic_pg_autogen.diff.DiffResult :canonical: alembic_pg_autogen.diff.diff .. autodoc2-docstring:: alembic_pg_autogen.diff.diff .. py:function:: _diff_items(current_items: collections.abc.Sequence[alembic_pg_autogen.diff._InfoT], desired_items: collections.abc.Sequence[alembic_pg_autogen.diff._InfoT], make_op: collections.abc.Callable[[alembic_pg_autogen.diff.Action, alembic_pg_autogen.diff._InfoT | None, alembic_pg_autogen.diff._InfoT | None], alembic_pg_autogen.diff._OpT]) -> list[alembic_pg_autogen.diff._OpT] :canonical: alembic_pg_autogen.diff._diff_items .. autodoc2-docstring:: alembic_pg_autogen.diff._diff_items :py:mod:`alembic_pg_autogen.render` =================================== .. py:module:: alembic_pg_autogen.render .. autodoc2-docstring:: alembic_pg_autogen.render :allowtitles: Module Contents --------------- Functions ~~~~~~~~~ .. list-table:: :class: autosummary longtable :align: left * - :py:obj:`_render_create_function ` - .. autodoc2-docstring:: alembic_pg_autogen.render._render_create_function :summary: * - :py:obj:`_render_replace_function ` - .. autodoc2-docstring:: alembic_pg_autogen.render._render_replace_function :summary: * - :py:obj:`_render_drop_function ` - .. autodoc2-docstring:: alembic_pg_autogen.render._render_drop_function :summary: * - :py:obj:`_render_create_trigger ` - .. autodoc2-docstring:: alembic_pg_autogen.render._render_create_trigger :summary: * - :py:obj:`_render_replace_trigger ` - .. autodoc2-docstring:: alembic_pg_autogen.render._render_replace_trigger :summary: * - :py:obj:`_render_drop_trigger ` - .. autodoc2-docstring:: alembic_pg_autogen.render._render_drop_trigger :summary: * - :py:obj:`_render_create_view ` - .. autodoc2-docstring:: alembic_pg_autogen.render._render_create_view :summary: * - :py:obj:`_render_replace_view ` - .. autodoc2-docstring:: alembic_pg_autogen.render._render_replace_view :summary: * - :py:obj:`_render_drop_view ` - .. autodoc2-docstring:: alembic_pg_autogen.render._render_drop_view :summary: * - :py:obj:`_render_execute ` - .. autodoc2-docstring:: alembic_pg_autogen.render._render_execute :summary: * - :py:obj:`_quote_ddl ` - .. autodoc2-docstring:: alembic_pg_autogen.render._quote_ddl :summary: API ~~~ .. py:function:: _render_create_function(_autogen_context: alembic.autogenerate.api.AutogenContext, op: alembic_pg_autogen.ops.CreateFunctionOp) -> str :canonical: alembic_pg_autogen.render._render_create_function .. autodoc2-docstring:: alembic_pg_autogen.render._render_create_function .. py:function:: _render_replace_function(_autogen_context: alembic.autogenerate.api.AutogenContext, op: alembic_pg_autogen.ops.ReplaceFunctionOp) -> str :canonical: alembic_pg_autogen.render._render_replace_function .. autodoc2-docstring:: alembic_pg_autogen.render._render_replace_function .. py:function:: _render_drop_function(_autogen_context: alembic.autogenerate.api.AutogenContext, op: alembic_pg_autogen.ops.DropFunctionOp) -> str :canonical: alembic_pg_autogen.render._render_drop_function .. autodoc2-docstring:: alembic_pg_autogen.render._render_drop_function .. py:function:: _render_create_trigger(_autogen_context: alembic.autogenerate.api.AutogenContext, op: alembic_pg_autogen.ops.CreateTriggerOp) -> str :canonical: alembic_pg_autogen.render._render_create_trigger .. autodoc2-docstring:: alembic_pg_autogen.render._render_create_trigger .. py:function:: _render_replace_trigger(_autogen_context: alembic.autogenerate.api.AutogenContext, op: alembic_pg_autogen.ops.ReplaceTriggerOp) -> list[str] :canonical: alembic_pg_autogen.render._render_replace_trigger .. autodoc2-docstring:: alembic_pg_autogen.render._render_replace_trigger .. py:function:: _render_drop_trigger(_autogen_context: alembic.autogenerate.api.AutogenContext, op: alembic_pg_autogen.ops.DropTriggerOp) -> str :canonical: alembic_pg_autogen.render._render_drop_trigger .. autodoc2-docstring:: alembic_pg_autogen.render._render_drop_trigger .. py:function:: _render_create_view(_autogen_context: alembic.autogenerate.api.AutogenContext, op: alembic_pg_autogen.ops.CreateViewOp) -> str :canonical: alembic_pg_autogen.render._render_create_view .. autodoc2-docstring:: alembic_pg_autogen.render._render_create_view .. py:function:: _render_replace_view(_autogen_context: alembic.autogenerate.api.AutogenContext, op: alembic_pg_autogen.ops.ReplaceViewOp) -> str :canonical: alembic_pg_autogen.render._render_replace_view .. autodoc2-docstring:: alembic_pg_autogen.render._render_replace_view .. py:function:: _render_drop_view(_autogen_context: alembic.autogenerate.api.AutogenContext, op: alembic_pg_autogen.ops.DropViewOp) -> str :canonical: alembic_pg_autogen.render._render_drop_view .. autodoc2-docstring:: alembic_pg_autogen.render._render_drop_view .. py:function:: _render_execute(ddl: str) -> str :canonical: alembic_pg_autogen.render._render_execute .. autodoc2-docstring:: alembic_pg_autogen.render._render_execute .. py:function:: _quote_ddl(ddl: str) -> str :canonical: alembic_pg_autogen.render._quote_ddl .. autodoc2-docstring:: alembic_pg_autogen.render._quote_ddl :py:mod:`alembic_pg_autogen.inspect` ==================================== .. py:module:: alembic_pg_autogen.inspect .. autodoc2-docstring:: alembic_pg_autogen.inspect :allowtitles: Module Contents --------------- Classes ~~~~~~~ .. list-table:: :class: autosummary longtable :align: left * - :py:obj:`FunctionInfo ` - .. autodoc2-docstring:: alembic_pg_autogen.inspect.FunctionInfo :summary: * - :py:obj:`TriggerInfo ` - .. autodoc2-docstring:: alembic_pg_autogen.inspect.TriggerInfo :summary: * - :py:obj:`ViewInfo ` - .. autodoc2-docstring:: alembic_pg_autogen.inspect.ViewInfo :summary: Functions ~~~~~~~~~ .. list-table:: :class: autosummary longtable :align: left * - :py:obj:`inspect_functions ` - .. autodoc2-docstring:: alembic_pg_autogen.inspect.inspect_functions :summary: * - :py:obj:`inspect_triggers ` - .. autodoc2-docstring:: alembic_pg_autogen.inspect.inspect_triggers :summary: * - :py:obj:`inspect_views ` - .. autodoc2-docstring:: alembic_pg_autogen.inspect.inspect_views :summary: * - :py:obj:`_build_schema_filter ` - .. autodoc2-docstring:: alembic_pg_autogen.inspect._build_schema_filter :summary: Data ~~~~ .. list-table:: :class: autosummary longtable :align: left * - :py:obj:`log ` - .. autodoc2-docstring:: alembic_pg_autogen.inspect.log :summary: * - :py:obj:`_EXCLUDED_SCHEMAS ` - .. autodoc2-docstring:: alembic_pg_autogen.inspect._EXCLUDED_SCHEMAS :summary: * - :py:obj:`_VIEWS_QUERY ` - .. autodoc2-docstring:: alembic_pg_autogen.inspect._VIEWS_QUERY :summary: * - :py:obj:`_FUNCTIONS_QUERY ` - .. autodoc2-docstring:: alembic_pg_autogen.inspect._FUNCTIONS_QUERY :summary: * - :py:obj:`_TRIGGERS_QUERY ` - .. autodoc2-docstring:: alembic_pg_autogen.inspect._TRIGGERS_QUERY :summary: API ~~~ .. py:data:: log :canonical: alembic_pg_autogen.inspect.log :value: 'getLogger(...)' .. autodoc2-docstring:: alembic_pg_autogen.inspect.log .. py:class:: FunctionInfo :canonical: alembic_pg_autogen.inspect.FunctionInfo Bases: :py:obj:`typing.NamedTuple` .. autodoc2-docstring:: alembic_pg_autogen.inspect.FunctionInfo .. py:attribute:: schema :canonical: alembic_pg_autogen.inspect.FunctionInfo.schema :type: str :value: None .. autodoc2-docstring:: alembic_pg_autogen.inspect.FunctionInfo.schema .. py:attribute:: name :canonical: alembic_pg_autogen.inspect.FunctionInfo.name :type: str :value: None .. autodoc2-docstring:: alembic_pg_autogen.inspect.FunctionInfo.name .. py:attribute:: identity_args :canonical: alembic_pg_autogen.inspect.FunctionInfo.identity_args :type: str :value: None .. autodoc2-docstring:: alembic_pg_autogen.inspect.FunctionInfo.identity_args .. py:attribute:: definition :canonical: alembic_pg_autogen.inspect.FunctionInfo.definition :type: str :value: None .. autodoc2-docstring:: alembic_pg_autogen.inspect.FunctionInfo.definition .. py:class:: TriggerInfo :canonical: alembic_pg_autogen.inspect.TriggerInfo Bases: :py:obj:`typing.NamedTuple` .. autodoc2-docstring:: alembic_pg_autogen.inspect.TriggerInfo .. py:attribute:: schema :canonical: alembic_pg_autogen.inspect.TriggerInfo.schema :type: str :value: None .. autodoc2-docstring:: alembic_pg_autogen.inspect.TriggerInfo.schema .. py:attribute:: table_name :canonical: alembic_pg_autogen.inspect.TriggerInfo.table_name :type: str :value: None .. autodoc2-docstring:: alembic_pg_autogen.inspect.TriggerInfo.table_name .. py:attribute:: trigger_name :canonical: alembic_pg_autogen.inspect.TriggerInfo.trigger_name :type: str :value: None .. autodoc2-docstring:: alembic_pg_autogen.inspect.TriggerInfo.trigger_name .. py:attribute:: definition :canonical: alembic_pg_autogen.inspect.TriggerInfo.definition :type: str :value: None .. autodoc2-docstring:: alembic_pg_autogen.inspect.TriggerInfo.definition .. py:class:: ViewInfo :canonical: alembic_pg_autogen.inspect.ViewInfo Bases: :py:obj:`typing.NamedTuple` .. autodoc2-docstring:: alembic_pg_autogen.inspect.ViewInfo .. py:attribute:: schema :canonical: alembic_pg_autogen.inspect.ViewInfo.schema :type: str :value: None .. autodoc2-docstring:: alembic_pg_autogen.inspect.ViewInfo.schema .. py:attribute:: name :canonical: alembic_pg_autogen.inspect.ViewInfo.name :type: str :value: None .. autodoc2-docstring:: alembic_pg_autogen.inspect.ViewInfo.name .. py:attribute:: definition :canonical: alembic_pg_autogen.inspect.ViewInfo.definition :type: str :value: None .. autodoc2-docstring:: alembic_pg_autogen.inspect.ViewInfo.definition .. py:function:: inspect_functions(conn: sqlalchemy.Connection, schemas: collections.abc.Sequence[str] | None = None) -> collections.abc.Sequence[alembic_pg_autogen.inspect.FunctionInfo] :canonical: alembic_pg_autogen.inspect.inspect_functions .. autodoc2-docstring:: alembic_pg_autogen.inspect.inspect_functions .. py:function:: inspect_triggers(conn: sqlalchemy.Connection, schemas: collections.abc.Sequence[str] | None = None) -> collections.abc.Sequence[alembic_pg_autogen.inspect.TriggerInfo] :canonical: alembic_pg_autogen.inspect.inspect_triggers .. autodoc2-docstring:: alembic_pg_autogen.inspect.inspect_triggers .. py:function:: inspect_views(conn: sqlalchemy.Connection, schemas: collections.abc.Sequence[str] | None = None) -> collections.abc.Sequence[alembic_pg_autogen.inspect.ViewInfo] :canonical: alembic_pg_autogen.inspect.inspect_views .. autodoc2-docstring:: alembic_pg_autogen.inspect.inspect_views .. py:data:: _EXCLUDED_SCHEMAS :canonical: alembic_pg_autogen.inspect._EXCLUDED_SCHEMAS :value: ('pg_catalog', 'information_schema') .. autodoc2-docstring:: alembic_pg_autogen.inspect._EXCLUDED_SCHEMAS .. py:data:: _VIEWS_QUERY :canonical: alembic_pg_autogen.inspect._VIEWS_QUERY :value: .. autodoc2-docstring:: alembic_pg_autogen.inspect._VIEWS_QUERY .. py:data:: _FUNCTIONS_QUERY :canonical: alembic_pg_autogen.inspect._FUNCTIONS_QUERY :value: .. autodoc2-docstring:: alembic_pg_autogen.inspect._FUNCTIONS_QUERY .. py:data:: _TRIGGERS_QUERY :canonical: alembic_pg_autogen.inspect._TRIGGERS_QUERY :value: .. autodoc2-docstring:: alembic_pg_autogen.inspect._TRIGGERS_QUERY .. py:function:: _build_schema_filter(schemas: collections.abc.Sequence[str] | None) -> tuple[str, dict[str, object]] :canonical: alembic_pg_autogen.inspect._build_schema_filter .. autodoc2-docstring:: alembic_pg_autogen.inspect._build_schema_filter :py:mod:`alembic_pg_autogen.compare` ==================================== .. py:module:: alembic_pg_autogen.compare .. autodoc2-docstring:: alembic_pg_autogen.compare :allowtitles: Module Contents --------------- Classes ~~~~~~~ .. list-table:: :class: autosummary longtable :align: left * - :py:obj:`_HasText ` - .. autodoc2-docstring:: alembic_pg_autogen.compare._HasText :summary: * - :py:obj:`SQLCreatable ` - .. autodoc2-docstring:: alembic_pg_autogen.compare.SQLCreatable :summary: Functions ~~~~~~~~~ .. list-table:: :class: autosummary longtable :align: left * - :py:obj:`setup ` - .. autodoc2-docstring:: alembic_pg_autogen.compare.setup :summary: * - :py:obj:`_compare_pg_objects ` - .. autodoc2-docstring:: alembic_pg_autogen.compare._compare_pg_objects :summary: * - :py:obj:`_resolve_ddl ` - .. autodoc2-docstring:: alembic_pg_autogen.compare._resolve_ddl :summary: * - :py:obj:`_filter_to_declared ` - .. autodoc2-docstring:: alembic_pg_autogen.compare._filter_to_declared :summary: * - :py:obj:`_parse_function_names ` - .. autodoc2-docstring:: alembic_pg_autogen.compare._parse_function_names :summary: * - :py:obj:`_parse_trigger_identities ` - .. autodoc2-docstring:: alembic_pg_autogen.compare._parse_trigger_identities :summary: * - :py:obj:`_parse_view_names ` - .. autodoc2-docstring:: alembic_pg_autogen.compare._parse_view_names :summary: * - :py:obj:`_get_default_schema ` - .. autodoc2-docstring:: alembic_pg_autogen.compare._get_default_schema :summary: * - :py:obj:`_resolve_schemas ` - .. autodoc2-docstring:: alembic_pg_autogen.compare._resolve_schemas :summary: * - :py:obj:`_filter_to_schemas ` - .. autodoc2-docstring:: alembic_pg_autogen.compare._filter_to_schemas :summary: * - :py:obj:`_order_ops ` - .. autodoc2-docstring:: alembic_pg_autogen.compare._order_ops :summary: Data ~~~~ .. list-table:: :class: autosummary longtable :align: left * - :py:obj:`log ` - .. autodoc2-docstring:: alembic_pg_autogen.compare.log :summary: * - :py:obj:`_VIEW_RE ` - .. autodoc2-docstring:: alembic_pg_autogen.compare._VIEW_RE :summary: API ~~~ .. py:data:: log :canonical: alembic_pg_autogen.compare.log :value: 'getLogger(...)' .. autodoc2-docstring:: alembic_pg_autogen.compare.log .. py:data:: _VIEW_RE :canonical: alembic_pg_autogen.compare._VIEW_RE :value: 'compile(...)' .. autodoc2-docstring:: alembic_pg_autogen.compare._VIEW_RE .. py:class:: _HasText :canonical: alembic_pg_autogen.compare._HasText Bases: :py:obj:`typing.Protocol` .. autodoc2-docstring:: alembic_pg_autogen.compare._HasText .. py:property:: text :canonical: alembic_pg_autogen.compare._HasText.text :type: str .. autodoc2-docstring:: alembic_pg_autogen.compare._HasText.text .. py:class:: SQLCreatable :canonical: alembic_pg_autogen.compare.SQLCreatable Bases: :py:obj:`typing.Protocol` .. autodoc2-docstring:: alembic_pg_autogen.compare.SQLCreatable .. py:method:: to_sql_statement_create() -> alembic_pg_autogen.compare._HasText :canonical: alembic_pg_autogen.compare.SQLCreatable.to_sql_statement_create .. autodoc2-docstring:: alembic_pg_autogen.compare.SQLCreatable.to_sql_statement_create .. py:function:: setup(plugin: alembic.runtime.plugins.Plugin) -> None :canonical: alembic_pg_autogen.compare.setup .. autodoc2-docstring:: alembic_pg_autogen.compare.setup .. py:function:: _compare_pg_objects(autogen_context: alembic.autogenerate.api.AutogenContext, upgrade_ops: alembic.operations.ops.UpgradeOps, schemas: set[str | None]) -> alembic.util.PriorityDispatchResult :canonical: alembic_pg_autogen.compare._compare_pg_objects .. autodoc2-docstring:: alembic_pg_autogen.compare._compare_pg_objects .. py:function:: _resolve_ddl(items: collections.abc.Sequence[str | alembic_pg_autogen.compare.SQLCreatable]) -> tuple[str, ...] :canonical: alembic_pg_autogen.compare._resolve_ddl .. autodoc2-docstring:: alembic_pg_autogen.compare._resolve_ddl .. py:function:: _filter_to_declared(canonical: alembic_pg_autogen.canonicalize.CanonicalState, pg_functions: collections.abc.Sequence[str], pg_triggers: collections.abc.Sequence[str], pg_views: collections.abc.Sequence[str], conn: sqlalchemy.Connection) -> alembic_pg_autogen.canonicalize.CanonicalState :canonical: alembic_pg_autogen.compare._filter_to_declared .. autodoc2-docstring:: alembic_pg_autogen.compare._filter_to_declared .. py:function:: _parse_function_names(ddl_list: collections.abc.Sequence[str], conn: sqlalchemy.Connection) -> set[tuple[str, str]] :canonical: alembic_pg_autogen.compare._parse_function_names .. autodoc2-docstring:: alembic_pg_autogen.compare._parse_function_names .. py:function:: _parse_trigger_identities(ddl_list: collections.abc.Sequence[str], conn: sqlalchemy.Connection) -> set[tuple[str, str, str]] :canonical: alembic_pg_autogen.compare._parse_trigger_identities .. autodoc2-docstring:: alembic_pg_autogen.compare._parse_trigger_identities .. py:function:: _parse_view_names(ddl_list: collections.abc.Sequence[str], conn: sqlalchemy.Connection) -> set[tuple[str, str]] :canonical: alembic_pg_autogen.compare._parse_view_names .. autodoc2-docstring:: alembic_pg_autogen.compare._parse_view_names .. py:function:: _get_default_schema(conn: sqlalchemy.Connection) -> str :canonical: alembic_pg_autogen.compare._get_default_schema .. autodoc2-docstring:: alembic_pg_autogen.compare._get_default_schema .. py:function:: _resolve_schemas(conn: sqlalchemy.Connection, schemas: collections.abc.Iterable[str | None]) -> list[str] | None :canonical: alembic_pg_autogen.compare._resolve_schemas .. autodoc2-docstring:: alembic_pg_autogen.compare._resolve_schemas .. py:function:: _filter_to_schemas(state: alembic_pg_autogen.canonicalize.CanonicalState, schemas: collections.abc.Iterable[str] | None) -> alembic_pg_autogen.canonicalize.CanonicalState :canonical: alembic_pg_autogen.compare._filter_to_schemas .. autodoc2-docstring:: alembic_pg_autogen.compare._filter_to_schemas .. py:function:: _order_ops(function_ops: collections.abc.Sequence[alembic_pg_autogen.diff.FunctionOp], trigger_ops: collections.abc.Sequence[alembic_pg_autogen.diff.TriggerOp], view_ops: collections.abc.Sequence[alembic_pg_autogen.diff.ViewOp]) -> list[alembic.operations.ops.MigrateOperation] :canonical: alembic_pg_autogen.compare._order_ops .. autodoc2-docstring:: alembic_pg_autogen.compare._order_ops