Package overview
The public surface spans three crates. Everything below is generated from the source, so a symbol’s page is the authority for its exact shape.
| Crate | What it is |
|---|---|
vgi | The worker framework: the function traits, Worker, catalogs, storage, transports. |
vgi-protocol | The wire types, re-exported by vgi at their original paths — cache_control, ipc, wire. |
vgi-client | The client: attach, discovery, and calling functions without DuckDB in the middle. |
The five traits
Section titled “The five traits”use vgi::function::ScalarFunction; // 1 row → 1 value
use vgi::table_function::TableFunction; // args → N rows (+ TableProducer)
use vgi::table_in_out::TableInOutFunction; // N rows → M rows, streaming
use vgi::aggregate::AggregateFunction; // N rows → 1 value per group
use vgi::buffering::TableBufferingFunction; // N rows → M rows, after all input
Each is registered on a Worker with the matching register_* call. copy_from and copy_to add
two more for custom COPY formats.
`Result` and `RpcError` come from the RPC layer
Every trait method returns vgi_rpc::Result. From the release after 0.29.0 the vgi crate
re-exports both, so use vgi::{Result, RpcError}; is the right version by construction. On
0.29.0 you need a direct vgi-rpc = "0.21" dependency — see the
tutorial for why the version matters.
Reference
Section titled “Reference”
Scalar functions
ScalarFunction, ArgSpec, the bind and process params.
Table functions
TableFunction and the producer that streams its rows.
Table-in-out functions
Streaming a relation through.
Buffering functions
Sink, combine, source.
Aggregate functions
Per-group accumulation over Vec state.
COPY formats
Your own format through COPY … FROM / TO.
Worker & serving
Worker, the four transports, the wasm entry points.
Catalogs
CatalogModel, schemas, tables, views, macros.
Arguments
Declaring a signature, reading the values.
Cache control
Advertising a result as reusable.
Pushdown & statistics
Predicates pushed toward the scan, and what you report back.
State storage
State across calls and across processes.
Secrets & settings
Credentials and session settings.
Protocol & Arrow
Wire shapes, IPC helpers, numeric utilities.
Client
Calling a worker from Rust.