Skip to content

Foundationdb Dotnet Client

C#/.NET Binding for FoundationDB Client API

Install: /plugin marketplace add SnowBankSDK/foundationdb-dotnet-client

Works with Claude Code · 158 GitHub stars

Install

$/plugin marketplace add SnowBankSDK/foundationdb-dotnet-client

Install command taken from the project's README or registry entry. Always review code before running it.

FoundationDB .NET Client

C#/.NET binding for the FoundationDB client library.

New to FoundationDB, or just trying it out? The documentation walks you through it end to end: Prerequisites, How it connects, Cluster setup, then Getting Started. It covers installing .NET and a local cluster, plus the one pitfall (matching the FoundationDB.Client.Native package to your cluster version) that otherwise shows up as mysterious timeouts.

Already know FoundationDB? The steps below get you running, and Getting Started has the first read and write.

How to use

Install the managed binding and the native client. Pin the native package to your cluster's major.minor version (see Cluster setup); it is the piece that must match your cluster:

dotnet add package FoundationDB.Client
dotnet add package FoundationDB.Client.Native --version "7.4.*"   # match your cluster's version

Register FoundationDB with the dependency-injection container in your Program.cs. This adds an IFdbDatabaseProvider singleton. Point it at a cluster one of three ways, most-preferred first:

// 1. Recommended: with the .NET Aspire integration, the AppHost supplies the connection.
//    Reference the FoundationDB.Aspire package, then:
builder.AddFoundationDb("fdb");

// 2. Manual, from an fdb.cluster file on disk:
builder.Services.AddFoundationDb(740, options =>
    options.ConnectionOptions.ClusterFile = "/etc/foundationdb/fdb.cluster");

// 3. Manual, from the cluster's connection string:
builder.Services.AddFoundationDb(740, options =>
    options.ConnectionOptions.ConnectionString = "docker:docker@127.0.0.1:4500");

The recommended path is .NET Aspire, which provisions a local cluster and injects the connection for you.

Inject that provider (it arrives as the db parameter below) and go through the retry loop. Here are two Minimal API endpoints: one lists every greeting, the other adds one.

// GET /greetings : read them all back
app.MapGet("/greetings", (IFdbDatabaseProvider db, CancellationToken ct) =>
    db.ReadAsync(async tr =>
    {
        // resolve the subspace where the Greetings collection's keys are stored
        var subspace = await db.Root["Examples"]["Greetings"].Resolve(tr);

        // scan every key under that subspace and decode each value back to text
        return await tr.GetRange(subspace.ToRange())
            .Select(kv => kv.Value.ToStringUtf8())
            .ToListAsync();
    }, ct));

Similar plugs

Turn any codebase, with its docs, SQL schemas, configs, and PDFs, into a queryable knowledge graph. A /graphify skill for Claude Code, Cursor, Codex, and Gemini CLI: local…

Why use many token when few token do trick. Viral skill + proxy for coding agents that cuts 65% of tokens by talking like a caveman.

Persistent Context Across Sessions for Every Agent, Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future…

Explore related