Skip to content
Query.Farm
Talk with Us

Vector Gateway Interface for C#

Extend DuckDB with vectorized C# functions — backed by Apache Arrow and callable directly from SQL.

QueryFarm.Vgi 0.3.0 is the .NET implementation of VGI. A worker registers typed functions, and DuckDB exchanges Apache Arrow record batches with it over stdio or a pooled Unix socket. The SDK targets .NET 10 and implements VGI protocol 1.4.0.

dotnet add package QueryFarm.Vgi --version 0.3.0
var worker = new Worker()
  .CatalogName("demo")
  .DefaultSchema("main")
  .RegisterCatalog(new CatalogInfo { Name = "demo" })
  .RegisterScalar(new UpperCaseFunction());

await worker.RunFromArgsAsync(args);
ATTACH 'launch:/absolute/path/to/demo' AS demo (TYPE vgi);
SELECT demo.upper_case('hello'); -- HELLO

The high-level C# package is a worker SDK. Worker.RunFromArgsAsync supports stdio and launch:’s AF_UNIX pooled transport. It does not currently expose the HTTP server, authentication, or shared-memory transports available in some other SDKs.

The separate QueryFarm.VgiRpc.Client 0.8.0 package is a complete generic VGI-RPC client. It handles RPC framing, streaming, compression, cancellation, and external payload resolution, but it does not provide the VGI-specific convenience API of Python’s VgiClient. See Calling workers from .NET.

All worker implementations speak the same protocol: a C# worker can be driven by the same DuckDB extension and conformance tests as Python, Go, TypeScript, Rust, or Java workers.