helix_ir.normalize¶
helix_ir.normalize — schema normalization.
- helix_ir.normalize.normalize(schema: Schema, strategy: str = '1nf', inline_threshold: int = 5) NormalizationPlan[source]¶
Normalize a nested Schema into a set of relational tables.
- Parameters:
schema – The source schema (may contain nested structs and arrays).
strategy – Normalization strategy: ‘1nf’ — extract all arrays to child tables, flatten structs. ‘mongo’ — keep arrays and structs as JSON/SUPER columns. ‘inline_small’ — inline small arrays (cardinality <= inline_threshold). ‘custom’ — same as ‘1nf’ (extend by subclassing decomposer).
inline_threshold – For ‘inline_small’, max cardinality to inline.
- Returns:
A NormalizationPlan with one or more Schema tables and FK relationships.