feat(sdk): forward kv-lance feature from surrealdb-core#35
Conversation
…ealdb-core The SDK crate (`surrealdb/Cargo.toml`, package `surrealdb`) is the public API surface most consumers use. It currently does NOT forward the `kv-lance` feature (and possibly others) from `surrealdb-core`. Downstream consumers depending on the SDK cannot reach the Lance backend even when they declare the feature. Concrete downstream impact (AdaWorldAPI/bardioc substrate-b): declared `features = ["kv-lance"]` on the SDK; `cargo check` did NOT error (Cargo silently ignores unknown features for path-patched deps); the resulting binary ran with `kv-mem` because `surrealdb-core`'s `kv-lance` was never activated transitively. The substrate-b binary therefore stored Lance data in memory, not in a Lance dataset — invalidating the substrate's whole point. Workaround documented at `bardioc/substrate-b/Cargo.toml` as a comment + flagged TD-B1-002 in `bardioc/.claude/TECH_DEBT.md`. This PR forwards the missing kv-* features on the SDK package so consumers can select their backend without depending on `surrealdb-core` directly. Forward-only; no behavior change to existing code; no breakage for consumers that already work. Provenance: - Surfaced by: bardioc B1-step2 brutal 02 (code-correctness lens) - Draft: `bardioc/.agent-logs/upstream-contributions/surrealdb-01-kv-lance-feature-on-sdk.md` - Severity P0 for any consumer trying to use the Lance backend via the public SDK
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughA new ChangesLance KV Store Feature
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f9bad5220b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| kv-rocksdb = ["surrealdb-core/kv-rocksdb", "tokio/time"] | ||
| kv-tikv = ["surrealdb-core/kv-tikv", "tokio/time"] | ||
| kv-surrealkv = ["surrealdb-core/kv-surrealkv", "tokio/time"] | ||
| kv-lance = ["surrealdb-core/kv-lance", "tokio/time"] |
There was a problem hiding this comment.
Wire Lance into the SDK connection layer
When an SDK consumer enables this feature and attempts to use the public API with a Lance endpoint such as Surreal::new::<Any>("lance://..."), the backend is still unreachable: EndpointKind::from maps lance to Unsupported in surrealdb/src/opt/endpoint/mod.rs, the native Any router has no Lance match arm, and engine::local is not enabled by kv-lance in surrealdb/src/engine/mod.rs. The connection therefore returns Unsupported scheme: lance even though this feature successfully enables the core backend, so the feature needs the corresponding SDK endpoint/router/local-engine wiring.
Useful? React with 👍 / 👎.
feat(sdk): add Lance backend struct + endpoint helper (companion to #35)
The bridge has been pinned at the stranded `claude/op-surreal-ast-field-types-stacked` branch since the D-AR-5.2 work first went up as nexgen-rs#29. That PR landed on a stacked branch instead of main and never made it back, so the nexgen-rs `main` diverged from the bridge's view for several sprints. The D-AR-5.2 work has now re-landed via nexgen-rs#36 (Kind variants + field_type consumer), and nexgen-rs `main` carries significant downstream improvements: - FK direction gating (#33) — only `belongs_to` emits a column - Polymorphic FK fallback (#30) — `option<any>` for unknown targets - Singularization tightening (#34, #35, #37) — fixes corpus quirks like `phases→Phase`, `children→Child`, `job_status→JobStatus`, `:big_integer→Decimal` - Phantom-table guard + order-independent ASSERTs (#27/#28/#26) - Rails type aliases (#37) The bridge's `From<ast::Kind> for catalog::Kind` impl already matches the 7 scalar variants the new main carries, so the bump is mechanical — `cargo check --features op-bridge` passes with no source changes needed. Updates Cargo.lock to the new rev (44550a87 — the merge commit of nexgen-rs#37 on main).
Summary
Forward the
kv-lancefeature fromsurrealdb-corethrough the SDK crate (surrealdb/Cargo.toml). Currently the SDK exposeskv-mem,kv-indxdb,kv-rocksdb,kv-tikv, andkv-surrealkvbut NOTkv-lance, even thoughsurrealdb-coreprovides the backend atsurrealdb/core/src/kvs/lance/(gated bysurrealdb-core/kv-lance).Concrete downstream impact
AdaWorldAPI/bardiocsubstrate-b declares the feature on the SDK:cargo checkdoes NOT error (Cargo silently ignores unknown features for path-patched deps), but the resulting binary runs withkv-membecausesurrealdb-core'skv-lancewas never activated transitively. The substrate-b binary therefore stores Lance data in memory, not in a Lance dataset — invalidating the substrate's whole point.Documented at
bardioc/substrate-b/Cargo.tomlas a comment + flagged TD-B1-002 inbardioc/.claude/TECH_DEBT.md.The change (1 line)
Inserted after
kv-surrealkv. Forward-only; no behavior change to existing code; no breakage for consumers that already work.Matches the pattern used by
kv-rocksdb,kv-tikv,kv-surrealkv(each forwarded assurrealdb-core/<feature>, tokio/time). Thetokio/timedep is included because LanceEmitter's batch flush is time-windowed.Provenance
bardioc/.claude/TECH_DEBT.mdTD-B1-002bardioc/.agent-logs/upstream-contributions/surrealdb-01-kv-lance-feature-on-sdk.mdSeverity
P0 for any consumer trying to use the Lance backend via the public SDK. Bardioc's whole substrate-b binary is hollow until this lands.
Asks
kv-*backends are reachable from the SDKlance-graphfeature (which forwardssurrealdb-core/lance-graph) should also be exposed at the SDK levelSummary by CodeRabbit