LoraDb.Client.Native
0.1.2
See the version list below for details.
dotnet add package LoraDb.Client.Native --version 0.1.2
NuGet\Install-Package LoraDb.Client.Native -Version 0.1.2
<PackageReference Include="LoraDb.Client.Native" Version="0.1.2" />
<PackageVersion Include="LoraDb.Client.Native" Version="0.1.2" />
<PackageReference Include="LoraDb.Client.Native" />
paket add LoraDb.Client.Native --version 0.1.2
#r "nuget: LoraDb.Client.Native, 0.1.2"
#:package LoraDb.Client.Native@0.1.2
#addin nuget:?package=LoraDb.Client.Native&version=0.1.2
#tool nuget:?package=LoraDb.Client.Native&version=0.1.2
LoraDb.Client
A modern .NET client for LoraDB — a graph database with a Cypher-like query language — supporting both HTTP and embedded (Rust FFI via P/Invoke) modes.
✨ Features
| Capability | Details |
|---|---|
| 🚀 Async-first | ExecuteAsync / ExecuteRowsAsync<T> returning IAsyncEnumerable |
| 🔒 Parameterized queries | Safe, strongly-typed parameter binding |
| 🔌 Dual transport | HTTP (lora-server) or embedded (lora_ffi) — swap at startup |
| 💉 DI-ready | AddLoraDb(…) extension for IServiceCollection |
| 📦 CRUD helpers | CreateNodeAsync, FindNodesAsync, UpdateNodesAsync, … |
| 🗂️ Batch execution | LoraDbBatch — sequential, fail-fast multi-statement runner |
| 🔧 Management API | Health, Explain, Profile, Snapshot, WAL status & truncate |
| 🎯 Multi-target | net10.0 and netstandard2.1 |
📦 Installation
dotnet add package LoraDb.Client
⚡ Quick start
using LoraDb.Client;
await using var client = LoraDbClient.CreateHttp(new Uri("http://127.0.0.1:4747/"));
UserNameRow? first = null;
await foreach (var row in client.ExecuteRowsAsync<UserNameRow>(
"MATCH (u:User) WHERE u.name = $name RETURN u.name AS name",
new Dictionary<string, object?> { ["name"] = "Alice" }))
{
first = row;
break;
}
var name = first?.Name;
public sealed class UserNameRow
{
public string Name { get; init; } = string.Empty;
}
Need low-level JSON access?
ExecuteAsyncreturnsLoraDbQueryResultwithRoot.
🔌 Runtime modes
HTTP mode
await using var client = LoraDbClient.CreateHttp(new Uri("http://127.0.0.1:4747/"));
Embedded mode
// In-memory (ephemeral)
await using var client = LoraDbClient.CreateEmbedded();
// Persistent on-disk
await using var client = LoraDbClient.CreateEmbedded(new LoraDbEmbeddedOpenOptions
{
DatabaseName = "app",
DatabaseDirectory = "/var/lib/loradb",
});
Embedded mode uses lora_ffi and expects these exported symbols:
lora_db_new,lora_db_new_named,lora_db_new_with_wallora_db_freelora_db_execute_json,lora_db_explain_json,lora_db_profile_jsonlora_db_save_snapshot,lora_db_load_snapshotlora_string_free
📖 Usage documentation
For a full guide covering HTTP mode, embedded mode, DI setup, result handling, and troubleshooting, see docs/USAGE.md.
🛠️ Development
dotnet restore LoraDb.Client.slnx
dotnet build LoraDb.Client.slnx
dotnet test LoraDb.Client.Tests/LoraDb.Client.Tests.csproj
Integration tests
Integration tests exercise real HTTP and embedded modes and require:
| Variable | Description |
|---|---|
LORADB_RUN_INTEGRATION_TESTS=1 |
Opt-in to run integration tests |
LORADB_FFI_LIBRARY_PATH |
Absolute path to lora_ffi binary (embedded mode) |
LORADB_HTTP_IMAGE (optional) |
Custom server image (defaults to ghcr.io/lora-db/lora-server:latest) |
dotnet test LoraDb.Client.IntegrationTests/LoraDb.Client.IntegrationTests.csproj
Build/pin native lora_ffi
The pinned upstream version is tracked in LoraDb.Client.Native/lora-ffi.version.
# Build using the currently pinned upstream ref
./scripts/build-lora-ffi.sh
# Update to a new upstream ref and persist the pin
./scripts/build-lora-ffi.sh --ref <tag-or-commit> --update-pin
🤝 Contributing
See CONTRIBUTING.md for commit conventions, branch workflow, and PR guidelines.
🔒 Security
Please do not open a public issue for vulnerabilities. See SECURITY.md for the responsible disclosure process.
📄 License
This project is licensed under the MIT License. Copyright © 2026 Harry Cordewener.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- LoraDb.Client (>= 0.1.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
## [0.1.2] — 2026-07-27 ### Bug Fixes - Add --api-key to dotnet nuget push for NuGet.org ([#44](https://github.com/HarryCordewener/loradb-client/issues/44))