Repository navigation
quack-rs v0.3.0
Added
-
TableFunctionBuilder— type-safe builder for registering DuckDB table functions
(theSELECT * FROM my_function(args)pattern). Covers the full bind/init/scan
lifecycle with ergonomic callbacks, eliminating ~100 lines of raw FFI boilerplate.
Helper typesBindInfo,FfiBindData<T>, andFfiInitData<T>manage parameter
extraction and per-scan state with zero raw pointer manipulation. See
tableandexamples/hello-ext(generate_series_ext) for
a fully-tested end-to-end example verified against DuckDB 1.4.4. -
ReplacementScanBuilder— builder for registering DuckDB replacement scans
(theSELECT * FROM 'file.xyz'pattern where a file path triggers a table-valued
scan). The builder handles callback registration, path extraction, and bind-info
population through a 4-method chain. Seereplacement_scan. -
StructVector— safe wrapper for reading and writing STRUCT child vectors.
get_child(vec, idx),field_reader(vec, idx, row_count), and
field_writer(vec, idx)replace manual offset arithmetic over child vector handles. -
ListVector— safe wrapper for reading and writing LIST child vectors.
get_child,get_entry,set_entry,reserve,set_size,child_reader, and
child_writercover the complete LIST read/write workflow without raw pointer casts. -
MapVector— safe wrapper for DuckDB MAP vectors (stored as
LIST<STRUCT{key, value}>).keys(vec),values(vec),struct_child(vec),
reserve,set_size,set_entry, andget_entryexpose the full MAP interface. -
vector::complexmodule — re-exportsStructVector,ListVector,MapVector
atquack_rs::vector::complexand documents the read-vs-write workflow for nested
types with working code examples in the module doc. -
preludeadditions —TableFunctionBuilder,BindInfo,FfiBindData,
FfiInitData,ReplacementScanBuilder,StructVector,ListVector,MapVector,
CastFunctionBuilder,CastFunctionInfo,CastMode
are now all re-exported fromquack_rs::prelude. -
CastFunctionBuilder— type-safe builder for registering custom type cast
functions viaduckdb_cast_function_*. Covers both explicitCAST(x AS T)and
implicit coercions (with optionalimplicit_cost). The companionCastFunctionInfo
wrapper exposescast_mode(),set_error(), andset_row_error()inside callbacks,
giving correctTRY_CAST/CASTerror handling with zero raw pointer boilerplate.
Seecastfor the full API. -
DbConfig— RAII wrapper forduckdb_config(extension configuration
parameters). Builder-style.set(name, value)?chain, automaticduckdb_destroy_config
on drop, andflag_count()/get_flag(index)for enumerating all available options.
Useful when an extension needs to open a secondaryDuckDBdatabase from within its
callbacks. Seeconfig. -
ScalarFunctionSetBuilder— builder for registering scalar function sets
(multiple overloads under one name), mirroringAggregateFunctionSetBuilder. -
TypeIdvariants —Decimal,Struct,Map,UHugeInt,TimeTz,
TimestampS,TimestampMs,TimestampNs,Array,Enum,Union,Bit. -
From<TypeId> for LogicalType— idiomatic conversion fromTypeId. -
#[must_use]on builder structs —ScalarFunctionBuilder,
AggregateFunctionBuilder,AggregateFunctionSetBuilder, andOverloadBuilder
now warn at compile time if constructed but never consumed. -
NullHandlingenum and.null_handling()builder method — configurable
NULL propagation for scalar and aggregate functions via
duckdb_scalar_function_set_special_handling/
duckdb_aggregate_function_set_special_handling. -
VectorWriter::write_interval— writes INTERVAL values to output vectors using
the correct 16-byte{ months: i32, days: i32, micros: i64 }layout. -
append_metadatabinary — native Rust replacement for the Python
append_extension_metadata.pyscript, now shipping with the crate.
Install withcargo install quack-rs --bin append_metadata. -
hello-extcast function demo —examples/hello-extnow registers a
CAST(VARCHAR AS INTEGER)cast function usingCastFunctionBuilder,
demonstrating bothCAST(abort-on-error) andTRY_CAST(NULL-on-error)
code paths. Five unit tests coverparse_varchar_to_int, including
boundary values and overflow.
Not implemented (upstream C API gap)
-
Window functions —
duckdb_create_window_functionand related symbols do
not exist in DuckDB's public C extension API. They are implemented only in the
C++ layer and are therefore not wrappable byquack-rsor any other C-API
binding. Verified against the
DuckDB stable C API reference
andlibduckdb-sys1.4.4 bindings. -
COPY format handlers —
duckdb_create_copy_functionand related symbols are
similarly absent from the C extension API for the same reason.
Fixed
hello-extgs_bindcallback — replaced incorrectduckdb_value_int64(param)
(wrong arity: takes 3 arguments) withduckdb_get_int64(param)(correct 1-argument
form). The extension now builds cleanly and all 11 live SQL tests pass against
DuckDB 1.4.4.
Changed
- Bump
criteriondev-dependency from0.5to0.8. - Bump
Swatinem/rust-cacheGitHub Action fromv2.7.5tov2.8.2. - Bump
dtolnay/rust-toolchainCI pin fromv2.7.5to latest SHA. - Bump
actions/attest-build-provenancefromv2tov4. - Bump
actions/configure-pagesto latest SHA (d5606572…). - Bump
actions/upload-pages-artifactfromv3.0.1tov4.0.0.