Skip to content
Query.Farm
Talk with Us

Package overview

@query-farm/vgi is one package with four entry points. Everything below is generated from the source, so a symbol’s page is the authority for its exact shape.

ImportFor
@query-farm/vgiNode / Bun workers. The function factories, Worker, catalogs, the client.
@query-farm/vgi/serveserveVgiWorker and createVgiWorkerFetch — an HTTP worker on Bun.
@query-farm/vgi/worker-cfCloudflare Workers. createVgiFetch plus the factories, on the flechette Arrow backend.
@query-farm/vgi/clientBrowser client only — no server-side code in the bundle.
The entry point changes what some names mean

int, int32, float32 and bool are type instances on the package root (re-exported from vgi-rpc) but factory functions on /worker-cf. int64(), float64() and the rest of the explicit factory set are functions on both, so prefer those in portable code. See Runtimes.

import {
defineScalarFunction,        // 1 row  → 1 value
defineTableFunction,         // args   → N rows
defineTableInOutFunction,    // N rows → M rows, streaming
defineAggregate,             // N rows → 1 value per group
defineTableBufferingFunction // N rows → M rows, after seeing all input
} from "@query-farm/vgi";

Each returns a VgiFunction, which is what a Worker or a FunctionRegistry accepts. There is also defineRowTransformFunction for the blended UNNEST-style table-in-out, and defineCopyFromFunction / defineCopyToFunction for custom COPY formats.