Skip to content

Conversation

@bligneri
Copy link

Hi there,

I understand DuckDB support was removed due to CGo dependencies and binary size concerns.

Since I need DuckDB support for a few projects, I'm proposing a different approach: opt-in support via build tags. This means:

  • Zero impact on default builds
  • DuckDB is completely excluded unless explicitly built with the duckdb tag
  • No CGo for regular users - the default goose binary remains CGo-free
  • Flexible build options - users who need DuckDB can choose the variant that fits their needs

Build Options

Three Makefile targets are provided for DuckDB builds:

  • make build-duckdb - full binary with debug symbols (~97MB)
  • make build-duckdb-nodebug - stripped binary (~73MB)
  • make build-duckdb-nodebug-compressed - UPX compressed (~18MB)

Binary Size Comparison (x86_64)

-rwxrwxr-x  1 ben ben  54M Oct 10 20:08 goose-default
-rwxrwxr-x  1 ben ben  37M Oct 10 20:22 goose-default-stripped
-rwxrwxr-x  1 ben ben  97M Oct 10 20:37 goose-duckdb
-rwxrwxr-x  1 ben ben  73M Oct 10 20:33 goose-duckdb-nodebug
-rwxrwxr-x  1 ben ben  18M Oct 10 20:30 goose-duckdb-nodebug-compressed
-rwxrwxr-x  1 ben ben 9.0M Oct 10 20:52 goose-nodebug-compressed

For the compression I used upx and the results are interesting for em.

Implementation

  • DuckDB dialect implementation in internal/dialects/duckdb.go
  • Build tag //go:build duckdb ensures opt-in only
  • Integration tests included (make test-duckdb)
  • Documentation updated in README.md

This approach allows DuckDB users to benefit from goose without impacting the default build for everyone else.

@mfridman
Copy link
Collaborator

mfridman commented Dec 1, 2025

When we get around to this, the Go driver (still CGO) moved to https://github.com/duckdb/duckdb-go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants