Skip to content

TS→Rust bridge (introspect + codegen) + split-by-population reframe#9

Merged
brentrager merged 1 commit into
mainfrom
ts-source-rust-bridge
Jun 29, 2026
Merged

TS→Rust bridge (introspect + codegen) + split-by-population reframe#9
brentrager merged 1 commit into
mainfrom
ts-source-rust-bridge

Conversation

@brentrager

Copy link
Copy Markdown
Contributor

Mirrors the smooai-postgres-kit reframe, applied deliberately to ClickHouse (the Postgres "richness wall" is mostly absent here, but the symmetry + TS authoring DX win, and the dynamic layer must stay Rust regardless):

  • Static, dev-authored CH tables (observability/metrics/billing) → TypeScript is source of truth (our existing @smooai/clickhouse-kit TS DSL). The Rust crate is the TS→Rust bridge: introspect (live → Rust) + codegen (ch_type_to_rust / rust_row_struct#[derive(Row)]) + check_drift (Rust view ≡ live).
  • Dynamic, customer/runtime tables (Ask-Your-Data / custom / audit) → Rust stays canonical (the safe-by-construction runtime engine — no TS source possible).

New: src/codegen.rs, src/introspect.rs, a 3rd testcontainers integration (create → introspect → generated Rust struct). README/ROADMAP/lib.rs reframed to the dual role. Scrubbed the last stray chkit temp-dir prefix (no ObsessionDB/chkit branding anywhere). Crate 0.1.0 → 0.2.0.

41 unit + 3 real-ClickHouse integration tests, clippy -D warnings clean.

🤖 Generated with Claude Code

…ulation

Reframe (mirrors smooai-postgres-kit): TypeScript is the source of truth for
STATIC dev-authored CH tables; the Rust crate is the TS→Rust BRIDGE for them, and
stays canonical for the DYNAMIC customer/runtime tables.

- codegen.rs: ch_type_to_rust + rust_row_struct (CH type → Rust type; emit a
  #[derive(Row)] struct; keyword-escaped fields).
- introspect.rs: introspect_columns + introspect_row_struct (live table → Rust
  source, the bridge one-liner) over the existing ChExecutor.
- 3rd testcontainers integration: create table → introspect → generated struct.
- README/ROADMAP reframed to the dual-role (bridge + runtime toolkit); lib.rs doc
  updated. Scrubbed the last stray 'chkit' temp-dir prefix — no obsession branding.
- crate 0.1.0 → 0.2.0 (new bridge API).

41 unit + 3 real-ClickHouse integration tests; fmt + clippy -D warnings clean.
@brentrager brentrager merged commit d7f3cf9 into main Jun 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant