Official C# binding for the Ladybug embedded graph database. It wraps the native Ladybug C API via P/Invoke and ships prebuilt native libraries for supported platforms, so you can run Cypher queries against an embedded graph database directly from .NET.
Status: under construction. See
.agents/notes/ROADMAP.mdfor progress.
net10.0(primary, AOT/trim friendly, source-generatedLibraryImport)netstandard2.0(broad reach, including .NET Framework)
using LadybugDB;
using var db = new Database("./demo.db");
using var conn = new Connection(db);
conn.Query("CREATE NODE TABLE Person(name STRING, age INT64, PRIMARY KEY(name))").Dispose();
conn.Query("CREATE (:Person {name: 'Alice', age: 30})").Dispose();
using var result = conn.Query("MATCH (p:Person) RETURN p.name, p.age");
foreach (var row in result.Rows())
{
Console.WriteLine($"{row[0]} is {row[1]} years old");
}dotnet build LadybugDB.slnx -c Release
dotnet test LadybugDB.slnx -c ReleaseThe binding needs the native Ladybug shared library at runtime (lbug_shared.dll /
liblbug.so / liblbug.dylib). When the native library is not available, the native round-trip
tests skip (the ABI/struct-layout guards still run).
This repo does not contain the engine source; the native library comes from the upstream Ladybug engine:
- CI / release (
.github/workflows/release.yml) downloads the prebuiltliblbug-*assets from an upstreamLadybugDB/ladybugGitHub Release (pinned viaENGINE_VERSION) and stages them intolib/runtimes/<rid>/native/before packing the multi-RID NuGet package. - Local development is easiest when this repo is checked out as the
tools/csharp_apisubmodule inside the Ladybug monorepo:scripts/build-native-and-test.ps1then buildslbug_sharedfrom the parent engine tree, stages it intolib/runtimes/win-x64/native/, and runs the suite.
See .agents/notes/HANDOFF.md for details.