Skip to main content

Module export

Module export 

Source

Modules§

python_snippet
Renders an “equivalent Python schema declaration” snippet for one MigrationStep — shown alongside the DDL preview in the interactive migration CLI, since Pylon has no separate SDL the way some other schema-migration tools do, and DDL alone is less immediately readable than the Python declaration it corresponds to.

Structs§

DeletionTriggerInfo
Structured description of one deletion-policy trigger (either a single-link Source-side DeleteTarget/DeleteTargetIfOrphan, a multilink Source-side DeleteTarget/DeleteTargetIfOrphan, or a multilink Target-side DeleteSource). Each trigger has its own dedicated function (unlike the exclusive-constraint triggers, no function sharing), so ddl carries the combined CREATE FUNCTION + CREATE TRIGGER block. Used by both export_schema (unconditional emission) and the diff engine (diff/mod.rs, comparing against live DbTable.triggers) so the two DDL-generation paths can’t drift the way they did before — the incremental migration path used to never emit these triggers at all.
ExclTriggerInfo
Structured description of one cross-table exclusive constraint trigger group. Used by the diff engine to detect added/removed triggers without re-parsing DDL.

Functions§

check_constraints
compile_index_fetch
Build the SQL that fetches source text for a batch of objects to embed.
compile_search_index_fetch
Like compile_index_fetch but for OpenSearch-backed SearchIndexes. Returns SQL that fetches source-text fields for a batch of object IDs.
deletion_policy_trigger_infos
Combined single-link + multilink deletion-policy trigger specs for schema. Public entry point for diff/mod.rs — see DeletionTriggerInfo.
export_schema
Export the full schema as a PostgreSQL DDL string.
function_ddl
Return CREATE OR REPLACE FUNCTION DDL for every user-defined function in schema.
function_ddl_with_names
Like function_ddl but also returns the module and function name for each entry.
interface_exclusive_trigger_infos
Collect all cross-table exclusive constraint trigger specs for schema.
interface_junction_view_ddl_with_names
Union views over each implementor’s junction table, one per (interface, multi-link or junction-backed link).
interface_view_ddl
Return CREATE OR REPLACE VIEW DDL for every interface type in schema.
interface_view_ddl_with_names
Like interface_view_ddl but also returns the module and view name for each entry.
junction_fk_constraints
(module, junction table, constraint name, ddl) for every junction’s target-side FK.
object_function_ddl_with_names
DDL for object-returning functions only — must be emitted after tables exist.
scalar_check_clauses
The CONSTRAINT … CHECK (…) clauses a CREATE DOMAIN for scalar needs.
scalar_check_constraints
(module, table, constraint name, DDL) for every CHECK the schema implies.
scalar_function_ddl_with_names
DDL for scalar (non-object-returning) functions only — safe to emit before tables.
signal_trigger_infos
One capture trigger per concrete type with at least one @pylon.signal handler registered — td.signals non-empty is the only condition, so a type nobody’s listening to gets no trigger and pays no per-mutation cost. Fires on every operation; the function body itself uses TG_OP to decide what to populate. Public entry point for diff/mod.rs, mirroring deletion_policy_trigger_infos.
user_trigger_infos
One CREATE FUNCTION + CREATE TRIGGER pair per user-declared schema Trigger. Public entry point for diff/mod.rs, mirroring deletion_policy_trigger_infos/signal_trigger_infos — the single source of truth both export_schema and migration-diff drift detection consult, so they can’t drift apart the way cache/signal triggers once did (see diff::expected_triggers’s own doc comment).
user_trigger_names
Just the (module, table, trigger_name) every user-declared Trigger should produce — no PyQL compilation, so (unlike user_trigger_infos) this is infallible and cheap enough for diff::expected_triggers to call on every diff/snapshot, not just when a trigger is actually being added.