You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DuckDB requires CGO (via go-duckdb C bindings), but CI builds with
CGO_ENABLED=0. This commit adds proper build constraints to ensure
sqlc builds successfully with or without CGO.
Changes:
- Move go-duckdb import to separate files with //go:build cgo constraint
- internal/cmd/vet_duckdb.go: DuckDB driver import (only with CGO)
- internal/engine/duckdb/analyzer/driver.go: DuckDB driver import (only with CGO)
- Remove go-duckdb import from main vet.go and analyze.go files
Build verification:
✅ CGO_ENABLED=1: Full DuckDB support, 121MB binary
✅ CGO_ENABLED=0: DuckDB excluded, 73MB binary (48MB smaller)
✅ Tests pass with CGO enabled
✅ Build succeeds with CGO disabled (CI requirement)
The cgo build tag automatically excludes these files when CGO is disabled,
allowing sqlc to build on all platforms while providing DuckDB support
when CGO is available.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
0 commit comments