Skip to main content

Module loader

Module loader 

Source
Expand description

Native Rust sidecar loader for migration files.

Reads NNNN_<name>.json sidecar files that the generator writes beside the corresponding NNNN_<name>.py source files. The sidecar carries the serde MigrationSpec produced from the same op list as the .py — so the Rust CLI can hydrate a MigrationGraph without importing Python.

The loader is pure std::fs + serde_json; it opens no TypeDB transaction and has no dependency on type_bridge_orm (invariant 7).

Functions§

load_dir
Walk dir and load all NNNN_*.json sidecar files into a sorted MigrationGraph.
load_dir_checked
Walk dir and load all NNNN_*.json sidecar files into a sorted MigrationGraph, then validate that each sidecar’s embedded source identity agrees with the current .py file.
load_sidecar
Load the sidecar spec for a given .py migration path.