Highly experimental Go implementation of the DuckDB quack extension.
Run make to build the extension or make test to build then load the extension into DuckDB and run the quack function.
quack.go: Pure extension logic - thequackscalar function implementationduckdbext/: Reusable framework for registering scalar functions, and dispatching callbackscbridge.go: Extension entry point, initialization, function registration, and CGO trampolines- Uses duckdb-go-bindings for all DuckDB C API calls
- Type-safe wrappers for
Vector,DataChunk,LogicalType, etc. - All data manipulation APIs (no manual C pointer arithmetic!)
- Memory-safe string handling (no manual
C.CString/C.free) - Function registration APIs
- Type-safe wrappers for
-
macOS (
PLATFORM=osx_arm64orosx_amd64):- Uses
-Wl,-undefined,dynamic_lookupso DuckDB resolves API symbols at load time. - Build:
make(auto-detects host), orPLATFORM=osx_arm64 make.
- Uses
-
Linux (
PLATFORM=linux_arm64orlinux_amd64):- Go build tag
duckdb_use_liblinks againstlibduckdb.so; the host DuckDB must match. - Ensure
libduckdb.sois on the default search path or setDUCKDB_LIB_PATH=/path/to/libduckdb.so.
- Go build tag
-
Windows:
- Not supported here because Windows requires all DuckDB C API symbols to be resolved at link time; the current build is designed around runtime symbol resolution (macOS) or linking to
libduckdb.so(Linux).
- Not supported here because Windows requires all DuckDB C API symbols to be resolved at link time; the current build is designed around runtime symbol resolution (macOS) or linking to