Skip to content

Commit a9fbfcb

Browse files
authored
Merge pull request #38 from AdaWorldAPI/claude/phase-2b-clickhouse-ddl-adapter
feat(ogar-adapter-clickhouse-ddl): scaffold ClickHouse DDL adapter — Phase 2b
2 parents 9c41346 + 01e3448 commit a9fbfcb

4 files changed

Lines changed: 589 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,9 @@ jobs:
4747
# free, but the round-trip tests need the parser.
4848
- name: cargo test -p ogar-adapter-ttl --features ttl-parser
4949
run: cargo test -p ogar-adapter-ttl --features ttl-parser
50+
# Exercise the `clickhouse-parser` feature on
51+
# ogar-adapter-clickhouse-ddl — pulls in sqlparser-rs with the
52+
# ClickHouseDialect for CREATE TABLE parsing. Same crate-scoped
53+
# gating pattern as the other adapter feature tests.
54+
- name: cargo test -p ogar-adapter-clickhouse-ddl --features clickhouse-parser
55+
run: cargo test -p ogar-adapter-clickhouse-ddl --features clickhouse-parser

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ members = [
88
"crates/ogar-proposal",
99
"crates/ogar-adapter-surrealql",
1010
"crates/ogar-adapter-ttl",
11+
"crates/ogar-adapter-clickhouse-ddl",
1112
"crates/ogar-knowable-from",
1213
]
1314

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[package]
2+
name = "ogar-adapter-clickhouse-ddl"
3+
version.workspace = true
4+
edition.workspace = true
5+
license.workspace = true
6+
repository.workspace = true
7+
authors.workspace = true
8+
rust-version.workspace = true
9+
description = "Bidirectional ClickHouse DDL bridge for OGAR. emit_clickhouse_ddl(Class) renders CREATE TABLE … ENGINE = MergeTree; parse_clickhouse_ddl (behind `clickhouse-parser`) drives sqlparser with the ClickHouseDialect and walks the AST back into Vec<Class>. Companion to ogar-adapter-surrealql + ogar-adapter-ttl; per Phase 2b of docs/RDF-OWL-ALIGNMENT.md §10. Composes with bardioc PR #19's substrate-b-shadow::ClickHouseQuery — the schema this adapter models is the schema the runtime decoder reads rows against."
10+
11+
[features]
12+
default = []
13+
serde = ["dep:serde", "ogar-vocab/serde"]
14+
# Enables ClickHouse DDL parsing via sqlparser-rs. Emit is feature-
15+
# free; only the AST walk requires the parser dep. Mirrors the
16+
# surrealql / ttl adapter pattern (the parser dep is the heavy
17+
# subscriber; consumers who only need emit don't pay for it).
18+
clickhouse-parser = ["dep:sqlparser"]
19+
20+
[dependencies]
21+
ogar-vocab = { path = "../ogar-vocab" }
22+
serde = { workspace = true, optional = true }
23+
# sqlparser 0.59 handles ClickHouse Nullable(X) cleanly under the
24+
# ClickHouseDialect (probed before adopting). Earlier versions
25+
# (≤0.50) choke on Nullable in CREATE TABLE.
26+
sqlparser = { version = "0.59", optional = true }

0 commit comments

Comments
 (0)