Commit 308f2e8
committed
feat(catalog/op_bridge): D-AR-6.2 — bridge 7 new ast::Kind variants (String/Bool/Float/Decimal/Datetime/Bytes/Uuid)
Catches up the C16c bridge to the AST surface PR #29 added on the
op-surreal-ast side. Without this, any `field_type`-derived
`ast::Kind::String` (etc.) in a Schema would fail to convert to
`catalog::Kind` once #29 merges.
# What this adds
`From<ast::Kind> for CatalogKind` gains 7 arms:
ast::Kind::String → CatalogKind::String
ast::Kind::Bool → CatalogKind::Bool
ast::Kind::Float → CatalogKind::Float
ast::Kind::Decimal → CatalogKind::Decimal
ast::Kind::Datetime → CatalogKind::Datetime
ast::Kind::Bytes → CatalogKind::Bytes
ast::Kind::Uuid → CatalogKind::Uuid
All seven are 1:1 mirrors of existing `surrealdb_core::expr::kind::Kind`
variants. Option-wrapping (Rails-nullable, per codex P1 fix in PR #29)
flows through the pre-existing `ast::Kind::Option(inner)` arm:
`ast::Kind::String.optional()` → `catalog::Kind::Either([None, String])`.
# Dep pin
`op-surreal-ast` git branch ref updated from
`claude/op-surreal-ast-from-triples` (PR #26 era, pre-D-AR-5.2) to
`claude/op-surreal-ast-field-types-stacked` (PR #29 with the new
variants). Flip to `branch = "main"` after #29 merges.
# Tests
`+2` new under `--features op-bridge`:
- `d_ar_6_2_scalar_variants_map_one_to_one` — every new ast variant
maps to the expected catalog variant.
- `d_ar_6_2_option_wrapped_scalar_bridges_via_either` — the
Rails-nullable Option<String> → catalog Either(None, String) chain
still works for the new variants.
# Forward-compat status (D-AR-6.3 deferred)
The `ast::FieldDefinition.assert: Option<String>` slot added in PR #27
is still ignored by the bridge (D-AR-6.3 follow-up). Lowering a
SurrealQL expression string to `catalog::Expr` requires either the
surrealdb-core SurrealQL parser (heavy) or a constrained
mini-parser for the few expressions the AR-shape extractor emits
(`$value != NONE` is the only one today). Punted to a focused PR.
# Iron-rule lock
Zero new types. Zero new traits. Seven additive match arms, all
1:1 with existing catalog variants. No behavioural drift on the
pre-existing 4 arms (Any/Int/Record/Option).1 parent 3aa6ab9 commit 308f2e8
3 files changed
Lines changed: 59 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
72 | 83 | | |
73 | 84 | | |
74 | 85 | | |
| |||
251 | 262 | | |
252 | 263 | | |
253 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
254 | 305 | | |
255 | 306 | | |
256 | 307 | | |
| |||
0 commit comments