Skip to content

feat(sdk): forward kv-lance feature from surrealdb-core#35

Merged
AdaWorldAPI merged 1 commit into
mainfrom
feat/sdk-forward-kv-lance
Jun 3, 2026
Merged

feat(sdk): forward kv-lance feature from surrealdb-core#35
AdaWorldAPI merged 1 commit into
mainfrom
feat/sdk-forward-kv-lance

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Summary

Forward the kv-lance feature from surrealdb-core through the SDK crate (surrealdb/Cargo.toml). Currently the SDK exposes kv-mem, kv-indxdb, kv-rocksdb, kv-tikv, and kv-surrealkv but NOT kv-lance, even though surrealdb-core provides the backend at surrealdb/core/src/kvs/lance/ (gated by surrealdb-core/kv-lance).

Concrete downstream impact

AdaWorldAPI/bardioc substrate-b declares the feature on the SDK:

surrealdb = { workspace = true, features = ["kv-lance"] }

cargo check does NOT error (Cargo silently ignores unknown features for path-patched deps), but the resulting binary runs with kv-mem because surrealdb-core's kv-lance was 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.toml as a comment + flagged TD-B1-002 in bardioc/.claude/TECH_DEBT.md.

The change (1 line)

kv-lance = ["surrealdb-core/kv-lance", "tokio/time"]

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 as surrealdb-core/<feature>, tokio/time). The tokio/time dep is included because LanceEmitter's batch flush is time-windowed.

Provenance

  • Surfaced by: bardioc B1-step2 brutal 02 (code-correctness lens)
  • Workaround documented at: bardioc/.claude/TECH_DEBT.md TD-B1-002
  • Draft proposal: 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. Bardioc's whole substrate-b binary is hollow until this lands.

Asks

  1. Merge the feature-forward
  2. Consider documenting in README/CHANGELOG which kv-* backends are reachable from the SDK
  3. Optional sibling: review whether the lance-graph feature (which forwards surrealdb-core/lance-graph) should also be exposed at the SDK level

Summary by CodeRabbit

  • New Features
    • Added new optional feature flag enabling additional storage functionality.

…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
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

A new kv-lance Cargo feature is added to surrealdb/Cargo.toml, wiring it to the corresponding feature in surrealdb-core and enabling the tokio/time dependency for asynchronous time operations.

Changes

Lance KV Store Feature

Layer / File(s) Summary
Cargo feature wiring
surrealdb/Cargo.toml
Adds the kv-lance feature flag that routes to surrealdb-core/kv-lance and enables tokio/time.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • AdaWorldAPI/surrealdb#28: Modifies the kv-lance feature and dependency wiring in the core package that this PR delegates to.
  • AdaWorldAPI/surrealdb#32: Updates the kv-lance-related dependency versions in the core package to align with this new feature declaration.

Poem

🐇 A feature flag hops into place,
enabling Lance's swift embrace,
tokio's time now ticks along,
surrealdb's key-value song grows strong! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(sdk): forward kv-lance feature from surrealdb-core' directly and accurately describes the primary change: adding a feature forward for kv-lance in the SDK's Cargo.toml.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/sdk-forward-kv-lance

Comment @coderabbitai help to get the list of available commands and usage tips.

@AdaWorldAPI AdaWorldAPI merged commit 20ed488 into main Jun 3, 2026
1 check was pending

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread surrealdb/Cargo.toml
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"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

AdaWorldAPI added a commit that referenced this pull request Jun 3, 2026
feat(sdk): add Lance backend struct + endpoint helper (companion to #35)
AdaWorldAPI pushed a commit that referenced this pull request Jun 17, 2026
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).
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