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.
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.
Structured description of one cross-table exclusive constraint trigger group.
Used by the diff engine to detect added/removed triggers without re-parsing DDL.
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.
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).
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.