B4n1.Db
0.1.4
dotnet add package B4n1.Db --version 0.1.4
NuGet\Install-Package B4n1.Db -Version 0.1.4
<PackageReference Include="B4n1.Db" Version="0.1.4" />
<PackageVersion Include="B4n1.Db" Version="0.1.4" />
<PackageReference Include="B4n1.Db" />
paket add B4n1.Db --version 0.1.4
#r "nuget: B4n1.Db, 0.1.4"
#:package B4n1.Db@0.1.4
#addin nuget:?package=B4n1.Db&version=0.1.4
#tool nuget:?package=B4n1.Db&version=0.1.4
b4n1-db — .NET SDK
Thin C# wrapper over the b4n1-db standalone binary. All storage, SQL, graph,
vector and audit logic lives in the binary; this package only invokes it. JSON
comes back as text, so the package has no dependencies: parse it with the JSON
library your application already uses.
Install
dotnet add package B4n1.Db
The binary is resolved in this order: B4N1_DB_BIN, the copy bundled under
native/ in the package, then b4n1-db on PATH.
Usage
using B4n1.Db;
var db = new Database("./data");
db.Kv.Put("greeting", "hello");
Console.WriteLine(db.Kv.Get("greeting")); // {"key":"greeting","value":"hello"}
db.Sql.Execute("CREATE TABLE u (id BIGINT, name VARCHAR)");
db.Sql.Execute("INSERT INTO u VALUES (1, 'ada')");
Console.WriteLine(db.Sql.Query("SELECT name FROM u"));
Console.WriteLine(db.Graph.AddNode("pattern", "ada")); // {"ok":true,"id":"…"}
db.Doc.Insert("notes", new Dictionary<string, object> { ["text"] = "first" });
db.Queue.Push("jobs", "build");
db.Audit.Verify();
Engines
| Group | Methods |
|---|---|
Kv |
Put, Get, Delete, Scan, PutTtl, Ttl, PurgeExpired |
Sql |
Execute, Query, Tables, RegisterCsv, RegisterJson, RegisterParquet, Drop |
Graph |
AddNode, AddRelation, Node, Search, Forget |
Doc |
Insert, FindOne, Find, FindByField, Update, Delete |
Queue |
Push, Pop, Peek, Ack, Nack, Clear, Len |
Vector |
Insert, Search, Delete, List |
Audit |
Verify, History, Latest, TimeTravel, RootHash |
Migration |
List, Add, Apply, Exec, Rollback |
Transfer |
Backup, Restore, Export, Import |
Vectors use the database dimension (1536 by default). Graph node types are
instruction, intention, contract, pattern, scaffold, qapair and
cyclerecord.
Test
B4N1_DB_BIN=/path/to/b4n1-db dotnet run --project tests/SurfaceSmoke
License
BUSL-1.1 (see LICENSE). Binaries are governed by EULA.txt.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- System.Text.Json (>= 8.0.5)
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.