Rust workspace for a typed database abstraction, code generator, cache layer, and optional Postgres adapter.
database— root crate; re-exportsnx_core, cache helpers, andPostgresAdapterbehind thepostgresfeaturedatabase-cli— schema validation and Rust code generationdatabase-codegen— generator library used by the CLIdatabase-cache— in-memory cache plus optional Redis backend viaredisdriver-postgres— SQLx-backed Postgres adapter
postgres— enablesdatabase::PostgresAdapteranddatabase::postgres::*cache-redis— forwards Redis support todatabase-cache
cargo run -p database-cli -- check --input examples/codegen/schema.json
cargo run -p database-cli -- generate --input examples/codegen/schema.json --output examples/codegen/models.rsChecked-in generated examples live in examples/codegen/ and are verified by tests to prevent drift.
Typical local sanity passes:
fish -lc 'cargo test'
fish -lc 'cargo check -p database --features postgres'
fish -lc 'cargo check -p database --features cache-redis'docs/architecture.mddocs/codegen.md