A thin C#/.NET wrapper for the SlateDb Rust library exposing the native SlateDb API via FFI for use from .NET applications.
Original SlateDb (Rust)
- Upstream Rust project: SlateDb
- This wrapper links to the Rust library (native binary/dynamic library) and provides a managed API surface.
Example :
using SlateDb.Configuration;
// create and open an in-memory slatedb instance
using var db = SlateDb.SlateDb
.Create<string, string>("db")
.WithObjectConfiguration(new MemoryStoreConfig())
.Build();
// put elements
db.Put("user:sylvain", "value1");
db.Put("user:melissa", "value2");
db.Put("user:lise", "value3");
db.Put("user:jules", "value4");
// get via a scan prefix
foreach (var kv in db.ScanPrefix("user:"))
Console.WriteLine($"{kv.Key} = {kv.Value}");Prerequisites:
- .NET SDK (dotnet)
- Rust toolchain (cargo, rustc)
- Platform toolchain (MSVC on Windows if using MSVC target)
Typical steps:
- Build the Rust library
./generate-binding.sh- Build the C# wrapper
dotnet build- Run the unit test to validate everything works
dotnet test- Start using the launcher (src/SlateDbLauncher) to do some tests
| SlateDb Version (Rust) | Binding Version (C#) | Status |
|---|---|---|
| 0.10.1 | 0.10.1 | DONE |
| 0.11.2 | 0.11.2 | DONE |
SlateDB .Net and the original SlateDb ifself is licensed under the Apache License, Version 2.0.
Contributions, issues and PRs welcome. Ensure the Rust upstream license and compatibility are respected when redistributing binaries.