Dbfy 0.4.1

dotnet add package Dbfy --version 0.4.1
                    
NuGet\Install-Package Dbfy -Version 0.4.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Dbfy" Version="0.4.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Dbfy" Version="0.4.1" />
                    
Directory.Packages.props
<PackageReference Include="Dbfy" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Dbfy --version 0.4.1
                    
#r "nuget: Dbfy, 0.4.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Dbfy@0.4.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Dbfy&version=0.4.1
                    
Install as a Cake Addin
#tool nuget:?package=Dbfy&version=0.4.1
                    
Install as a Cake Tool

Dbfy — .NET binding

Each source is a SQL table: REST APIs, log files, CSV, JSONL, syslog — one schema, cross-source JOINs. .NET wrapper over the dbfy embedded SQL federation engine.

using Dbfy;
using Apache.Arrow;

using var engine = Engine.FromYaml("""
    version: 1
    sources:
      gh:
        type: rest
        base_url: https://api.github.com
        auth: { type: bearer, token_env: GITHUB_TOKEN }
        tables:
          issues:
            endpoint: { method: GET, path: /repos/duckdb/duckdb/issues }
            root: "$[*]"
            columns:
              number: { path: "$.number", type: int64 }
              title:  { path: "$.title",  type: string }
              state:  { path: "$.state",  type: string }
    """);

using var result = engine.Query(
    "SELECT count(*) FROM gh.issues WHERE state = 'open'");

Console.WriteLine($"open: {result.RowCount}");

foreach (RecordBatch batch in result)
{
    // Apache.Arrow.RecordBatch — typed columns, zero-copy import via
    // the C Data Interface. Plug into Microsoft.Data.Analysis,
    // PowerBI's PowerQuery, LINQ, or any other Arrow-native consumer.
}

Install

dotnet add package Dbfy

The NuGet package ships native binaries for linux-x64 and osx-arm64 under runtimes/<rid>/native/. Other platforms can build from source — see the workspace README.

API surface

Type Purpose
Engine.FromYaml(string) Build engine from inline YAML config
Engine.FromPath(string) Build engine from a YAML file path
Engine.NewEmpty() Engine with no preconfigured sources
Engine.Query(sql) Execute SQL → Result
Engine.Explain(sql) Render optimised plan + pushdown summary
Result.BatchCount / RowCount Result sizes
Result.GetBatch(i) Import the i-th batch as Apache.Arrow.RecordBatch
IEnumerable<RecordBatch> on Result foreach iteration
DbfyException Wraps dbfy_last_error thread-local

Architecture

The .NET binding is a thin P/Invoke layer over the existing C library (dbfy-c, include/dbfy.h). The dbfy engine emits Arrow record batches via the Arrow C Data Interface; the .NET side imports them zero-copy through Apache.Arrow.C.CArrowArrayImporter so each RecordBatch shares buffers with the original Rust-side allocation. There is no serialisation step.

┌──────────────────┐  Arrow C Data Interface (zero-copy)  ┌────────────┐
│  Rust dbfy core  │ ─────────────────────────────────▶  │  Apache    │
│  (DataFusion)    │                                       │  .Arrow    │
└──────────────────┘                                       │  C# types  │
                                                           └────────────┘

Local development

# 1. Build the native dbfy library.
cargo build -p dbfy-c --release         # produces target/release/libdbfy.so

# 2. Point the .NET resolver at it.
export DBFY_NATIVE_DIR=$PWD/target/release

# 3. Build + test.
dotnet test bindings/csharp/Dbfy.sln

Dbfy/Native.cs installs an NativeLibrary.SetDllImportResolver that looks at DBFY_NATIVE_DIR first, then falls through to the standard runtime search path (which is what NuGet's runtimes/<rid>/native populates).

License

Apache-2.0 — same as the parent dbfy workspace.

Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.4.1 91 5/2/2026
0.4.0 85 5/2/2026
0.3.0 87 5/2/2026
0.2.0 96 5/2/2026
0.1.0 88 5/2/2026