Skip to content

feat(targets): add target-ladybug (Kuzu successor)#95

Merged
bashandbone merged 4 commits intomainfrom
copilot/add-ladybug-target-feature
Mar 16, 2026
Merged

feat(targets): add target-ladybug (Kuzu successor)#95
bashandbone merged 4 commits intomainfrom
copilot/add-ladybug-target-feature

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 13, 2026

Kuzu (property graph DB) was archived Oct 2025. Ladybug is its actively maintained fork with an identical Cypher API server interface. This adds target-ladybug as a first-class feature-gated target, mirroring the upstream CocoIndex PR #1487.

Changes

  • ops/targets/ladybug.rs — New file, adapted from kuzu.rs via mechanical Kuzu*Ladybug* rename. Also fixes a pre-existing typo (cyper_buildercypher_builder) and updates the doc URL to the LadybugDB GitHub repo.
  • ops/targets/mod.rs — Adds pub mod ladybug under #[cfg(feature = "target-ladybug")]; extends the pub mod shared any(...) guard.
  • prelude.rs — Extends the recoco_utils::http re-export guard to include target-ladybug.
  • ops/registration.rs — Registers LadybugFactory; reqwest_client is now created when either target-kuzu or target-ladybug is enabled. When both features are active, kuzu gets .clone() and ladybug gets the move to satisfy clippy::redundant_clone.
  • Cargo.toml — Adds target-ladybug = ["dep:reqwest", "recoco-utils/reqwest", "target-neo4j"] (identical deps to target-kuzu); includes it in all-targets and full bundles.

Usage

# Cargo.toml
recoco-core = { features = ["target-ladybug"] }
// Spec is structurally identical to Kuzu — just use "Ladybug" as the target kind
let spec = Spec {
    connection: AuthEntryReference::new("my_ladybug_conn"),
    mapping: GraphElementMapping { ... },
};

The target-kuzu feature remains available; deprecation is a follow-up concern per upstream guidance.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Upstream-Sync] [FEATURE] Add Ladybug target (Kuzu successor) — upstream PR #1487</issue_title>
<issue_description>### Summary

Adapt the upstream new target from cocoindex-io/cocoindex#1487: add Ladybug as a new target-ladybug feature-gated graph database target in Recoco, replacing the archived Kuzu project.

Background

  • Kuzu (MIT-licensed property graph DB) was archived in October 2025.
  • Ladybug is its actively maintained fork with an identical Cypher API server interface.
  • Upstream PR knitli/recoco#1487 adds Ladybug as a first-class target, with a note to eventually retire the Kuzu target.
  • Recoco already has a full target-kuzu implementation in crates/recoco-core/src/ops/targets/kuzu.rs using the same API server-based thin-client approach.

What changes upstream?

  • New file: rust/cocoindex/src/ops/targets/ladybug.rs — a near-identical copy of kuzu.rs with all Kuzu* symbols renamed to Ladybug*
  • rust/cocoindex/src/ops/targets/mod.rs — adds pub mod ladybug
  • rust/cocoindex/src/ops/registration.rs — registers the Ladybug factory, cloning the reqwest_client

Action for Recoco

  1. Create crates/recoco-core/src/ops/targets/ladybug.rs by adapting the upstream file. This is largely a mechanical rename of kuzuladybug, with one API callsite to verify (see note below).
  2. Update crates/recoco-core/src/ops/targets/mod.rs to add:
    #[cfg(feature = "target-ladybug")]
    pub mod ladybug;
    Also update the #[cfg(any(...))] guard on pub mod shared to include target-ladybug.
  3. Update crates/recoco-core/Cargo.toml:
    • Add target-ladybug feature: target-ladybug = ["dep:reqwest", "recoco-utils/reqwest", "target-neo4j"] (same deps as target-kuzu)
    • Add target-ladybug to the all-targets and full bundles
  4. Register the Ladybug factory in registration (wherever kuzu::register is called).
  5. Decide on a deprecation or migration path for target-kuzu — upstream recommends retiring Kuzu in favour of Ladybug.

⚠️ API compatibility note

Recoco's kuzu.rs calls http::request(|| ...) (zero-arg closure), while the upstream ladybug.rs calls http::request(&self.reqwest_client, |client| ...) (two-arg form). Verify which signature recoco-utils/http currently exposes before copying the upstream code verbatim.

Recoco mapping

Upstream Recoco
rust/cocoindex/src/ops/targets/ladybug.rs crates/recoco-core/src/ops/targets/ladybug.rs
rust/cocoindex/src/ops/targets/mod.rs crates/recoco-core/src/ops/targets/mod.rs
rust/cocoindex/src/ops/registration.rs Registration module in recoco-core
Feature target-kuzu (upstream, to be deprecated) target-kuzu in Recoco (consider deprecation path)

References

Comments on the Issue (you are @copilot in this section)


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 13, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
recoco-docs acdbfb6 Mar 13 2026, 09:33 PM

…ature gates

Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
Copilot AI changed the title [WIP] [Upstream-Sync] Add Ladybug target feature in Recoco feat(targets): add target-ladybug (Kuzu successor) Mar 13, 2026
Copilot AI requested a review from bashandbone March 13, 2026 20:41
@bashandbone bashandbone marked this pull request as ready for review March 13, 2026 21:09
Copilot AI review requested due to automatic review settings March 13, 2026 21:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new feature-gated target-ladybug graph-db target (Ladybug as Kuzu successor) and wires it into target modules, prelude exports, factory registration, and Cargo features.

Changes:

  • Introduces ops/targets/ladybug.rs implementing the Ladybug target.
  • Extends target module wiring/registration and shared gating to include target-ladybug.
  • Adds the target-ladybug Cargo feature and includes it in all-targets.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/recoco-core/src/prelude.rs Extends recoco_utils::http re-export gating to include target-ladybug.
crates/recoco-core/src/ops/targets/mod.rs Adds ladybug module behind feature flag; includes it in shared target gating.
crates/recoco-core/src/ops/targets/ladybug.rs New Ladybug target implementation (thin Cypher-over-HTTP client, setup/mutation logic).
crates/recoco-core/src/ops/registration.rs Registers Ladybug factory and adjusts reqwest::Client construction/ownership across targets.
crates/recoco-core/Cargo.toml Adds target-ladybug feature and includes it in all-targets.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +247 to +260
cypher.query_mut().push_str(
keys.iter()
.chain(values.iter())
.map(|(name, ladybug_type)| format!("{name} {ladybug_type}"))
.join(", ")
.as_str(),
);
match elem_type {
ElementType::Node(_) => {
write!(
cypher.query_mut(),
", {SELF_CONTAINED_TAG_FIELD_NAME} BOOL, PRIMARY KEY ({})",
keys.iter().map(|(name, _)| name).join(", ")
)?;
Comment on lines +41 to +47

#[derive(Debug, Serialize, Deserialize)]
pub struct Spec {
connection: spec::AuthEntryReference<ConnectionSpec>,
mapping: GraphElementMapping,
}

@bashandbone bashandbone added enhancement New feature or request upstream-sync Issues for syncing updates with our upstream (cocoindex-io/cocoindex) labels Mar 13, 2026
@bashandbone
Copy link
Copy Markdown
Contributor

@copilot apply changes based on the comments in this thread

… add serde-only doc comments

Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 13, 2026

@copilot apply changes based on the comments in this thread

Applied both review changes in acdbfb6:

  1. Itertools .join() on iterators — replaced the two iterator .join(", ") calls (lines 251 and 259) with .collect::<Vec<_>>().join(", ") so there's no dependency on itertools::Itertools. The third .join() at line 147 was already on a Vec<String> (after .collect::<Result<Vec<_>>>()?) and used std, so it was left as-is.

  2. Field visibility on ConnectionSpec / Spec — All other targets in this codebase (kuzu, neo4j, qdrant, postgres) use the same pattern of pub struct with private fields for serde-deserialized config types; making fields pub would diverge from that convention. Instead, added doc comments to both structs explicitly noting they are "serde-deserialized config-only types; populate via the auth-entry / YAML configuration rather than direct construction."

@bashandbone bashandbone merged commit 348d96c into main Mar 16, 2026
7 of 8 checks passed
@bashandbone bashandbone deleted the copilot/add-ladybug-target-feature branch March 16, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request upstream-sync Issues for syncing updates with our upstream (cocoindex-io/cocoindex)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Upstream-Sync] [FEATURE] Add Ladybug target (Kuzu successor) — upstream PR #1487

3 participants