0.3.0: merge #8 (partition/ttl/index/settings + TS/Zod codegen) with the TS→Rust bridge#11
Merged
Conversation
…parametrised DateTime64
Adds the structural DDL knobs the SmooAI observability + audit ClickHouse tables
need so the Rust kit can express the real production schema — it previously
modeled only name/columns/engine/order_by, which couldn't represent any of the
o11y tables (all use PARTITION BY; traces/logs use TTL/INDEX/SETTINGS; audit uses
DateTime64 with an explicit timezone). Per the kit principle, the gap lands in
the crate, not app code.
- TableSpec + FlexibleConfig gain partition_by / ttl / indexes / settings.
- to_create_table_sql renders INDEX lines (inside the column parens), PARTITION
BY (between ENGINE and ORDER BY), TTL (DateTime64 ttl column auto-wrapped in
toDateTime()), and SETTINGS — fully backward-compatible when all are empty/None.
- New IndexSpec / TtlSpec / TtlMove types. Safety posture: partition_by, index
expression/type, ttl intervals/volume, and settings values are app-controlled
raw fragments (like engine); only identifiers (table/column/index name, ttl
column, order_by) are validated, and ttl/order_by columns must be real columns.
- ColumnTypeSpec::DateTime64 { datetime64: DateTime64Spec } with validated
precision (0..=9) + IANA-charset timezone; bare "DateTime64" still renders (3).
- Version 0.1.0 -> 0.2.0. +12 tests (45 -> 51 unit), fmt/clippy clean.
Consumed by SmooAI/smooai SMOODEV-2115 (observability_logs/observability_traces
in api-prime, audit_log_events in audit-worker).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…o rs-0.3.0-integrate # Conflicts: # ROADMAP.md # crates/clickhouse-kit/src/codegen.rs # crates/clickhouse-kit/src/lib.rs
🦋 Changeset detectedLatest commit: a5c615a The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves the version collision: #8 (production-table DDL:
PARTITION BY/TTL/INDEX/SETTINGS, parametrizedDateTime64(p, tz), + TS/Zod codegen — SMOODEV-2115) and the TS→Rust bridge (codegen Rust rows + introspect, merged to main as 0.2.0) both wanted0.2.0. This merges them into0.3.0so both ship.table.rs/safety.rs/flexible.rs/evolve.rs/flatten.rs/drift.rs(applied cleanly — the bridge didn't touch them).codegen.rs: my ClickHouse→Rust row emit (ch_type_to_rust/rust_row_struct) + feat: production-table DDL (PARTITION/TTL/INDEX/SETTINGS) + parametrised DateTime64 #8'sTableSpec→TS/Zod emit (emit_row_interface/emit_select_schema/emit_insert_schema/emit_ts_module). Ungated codegen (was behind an off-by-default feature; my bridge needs it always) — no extra deps.lib.rsexports; reframedROADMAP/READMEto the dual role; version → 0.3.0, lockfile synced.61 unit + 3 real-ClickHouse testcontainers integration tests (DDL round-trip; migrate + drift; introspect → codegen), clippy
-D warningsclean.Supersedes #8 (will close it). The monorepo adoption PR #2020 should pin
smooai-clickhouse-kit = "0.3".🤖 Generated with Claude Code