alembic_pg_autogen.inspect¶
Catalog inspection for PostgreSQL functions and triggers.
Module Contents¶
Classes¶
A PostgreSQL function or procedure as loaded from the system catalog. |
|
A PostgreSQL trigger as loaded from the system catalog. |
Functions¶
Bulk-load function definitions from PostgreSQL system catalogs. |
|
Bulk-load trigger definitions from PostgreSQL system catalogs. |
|
Build the SQL WHERE clause fragment and bind params for schema filtering. |
Data¶
API¶
- alembic_pg_autogen.inspect.log = 'getLogger(...)'¶
- class alembic_pg_autogen.inspect.FunctionInfo¶
Bases:
typing.NamedTupleA PostgreSQL function or procedure as loaded from the system catalog.
- class alembic_pg_autogen.inspect.TriggerInfo¶
Bases:
typing.NamedTupleA PostgreSQL trigger as loaded from the system catalog.
- alembic_pg_autogen.inspect.inspect_functions(conn: sqlalchemy.Connection, schemas: collections.abc.Sequence[str] | None = None) collections.abc.Sequence[alembic_pg_autogen.inspect.FunctionInfo]¶
Bulk-load function definitions from PostgreSQL system catalogs.
Queries
pg_procjoined withpg_namespaceto retrieve all user-defined functions and procedures. Usespg_get_functiondef()for canonical DDL andpg_get_function_identity_arguments()for the overload-distinguishing argument signature.- Args:
conn: An open SQLAlchemy connection. schemas: Optional list of schema names to inspect. When None, all schemas except
pg_catalogandinformation_schemaare included.- Returns:
A sequence of
FunctionInfoinstances, one per function/procedure.
- alembic_pg_autogen.inspect.inspect_triggers(conn: sqlalchemy.Connection, schemas: collections.abc.Sequence[str] | None = None) collections.abc.Sequence[alembic_pg_autogen.inspect.TriggerInfo]¶
Bulk-load trigger definitions from PostgreSQL system catalogs.
Queries
pg_triggerjoined withpg_classandpg_namespaceto retrieve all user-defined (non-internal) triggers. Usespg_get_triggerdef()for canonical DDL.- Args:
conn: An open SQLAlchemy connection. schemas: Optional list of schema names to inspect. When None, all schemas except
pg_catalogandinformation_schemaare included.- Returns:
A sequence of
TriggerInfoinstances, one per trigger.
- alembic_pg_autogen.inspect._EXCLUDED_SCHEMAS = ('pg_catalog', 'information_schema')¶
- alembic_pg_autogen.inspect._FUNCTIONS_QUERY = <Multiline-String>¶
- alembic_pg_autogen.inspect._TRIGGERS_QUERY = <Multiline-String>¶