Skip to main content

Module codegen

Module codegen 

Source
Expand description

Schema-driven typed client codegen (HelixDB-inspired, ADR-252 P6).

HelixDB compiles a schema into typed API endpoints + multi-language SDKs so callers get compile-time-checked node/edge/vector types. This module does the same from a GraphSchema: it emits TypeScript, Python, and Rust type definitions plus a vector-type manifest. Output is deterministic (schema elements are sorted) so it can be checked in and diffed.

These are type stubs — the single source of truth is the schema. The generated code carries the labels, property names/types, edge from/to constraints, and vector dimensions/metrics across the language boundary.

Functions§

generate_python
Generate Python TypedDict classes + a vector-type manifest from the schema.
generate_rust
Generate Rust structs from the schema (serde-ready).
generate_typescript
Generate TypeScript interfaces + a vector-type manifest from the schema.