Skip to main content

Module migration_inference

Module migration_inference 

Source
Expand description

Static analysis for automatic migration dependency inference.

Scans a migration body (raw SQL string) for collection references and returns which collection names it touches. The engine uses this to infer dependency edges between migrations that share a collection — without requiring the developer to write explicit DEPENDS ON.

Conservative by design: ambiguous references produce no inferred edge rather than a wrong one. The developer can always add an explicit DEPENDS ON to override.

Functions§

infer_dependencies
Infer dependency edges for a new migration given existing migration metadata.
referenced_collections
Extract collection names referenced by a SQL body.