From e9a8cbf20fdf0c5fa291cda65e858656ec32af58 Mon Sep 17 00:00:00 2001 From: Egutierrez Date: Thu, 2 Apr 2026 22:03:49 +0200 Subject: [PATCH] feat: build tags y stubs para clickhouse y duckdb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AƱade build tags noclickhouse/noduckdb a las implementaciones reales y crea stubs que devuelven error para compilar sin las dependencias CGO. Co-Authored-By: Claude Opus 4.6 (1M context) --- functions/infra/clickhouse_open.go | 2 ++ functions/infra/clickhouse_open_stub.go | 13 +++++++++++++ functions/infra/duckdb_open.go | 2 ++ functions/infra/duckdb_open_stub.go | 13 +++++++++++++ 4 files changed, 30 insertions(+) create mode 100644 functions/infra/clickhouse_open_stub.go create mode 100644 functions/infra/duckdb_open_stub.go diff --git a/functions/infra/clickhouse_open.go b/functions/infra/clickhouse_open.go index 8d69e4c4..d9549193 100644 --- a/functions/infra/clickhouse_open.go +++ b/functions/infra/clickhouse_open.go @@ -1,3 +1,5 @@ +//go:build !noclickhouse + package infra import ( diff --git a/functions/infra/clickhouse_open_stub.go b/functions/infra/clickhouse_open_stub.go new file mode 100644 index 00000000..5a09807e --- /dev/null +++ b/functions/infra/clickhouse_open_stub.go @@ -0,0 +1,13 @@ +//go:build noclickhouse + +package infra + +import ( + "database/sql" + "fmt" +) + +// ClickHouseOpen is a stub when built with the noclickhouse tag. +func ClickHouseOpen(host string, port int, user, password, database string) (*sql.DB, error) { + return nil, fmt.Errorf("clickhouse_open: clickhouse support not compiled (built with noclickhouse tag)") +} diff --git a/functions/infra/duckdb_open.go b/functions/infra/duckdb_open.go index 9a240a8c..7870b8dd 100644 --- a/functions/infra/duckdb_open.go +++ b/functions/infra/duckdb_open.go @@ -1,3 +1,5 @@ +//go:build !noduckdb + package infra import ( diff --git a/functions/infra/duckdb_open_stub.go b/functions/infra/duckdb_open_stub.go new file mode 100644 index 00000000..a11124f2 --- /dev/null +++ b/functions/infra/duckdb_open_stub.go @@ -0,0 +1,13 @@ +//go:build noduckdb + +package infra + +import ( + "database/sql" + "fmt" +) + +// DuckDBOpen is a stub when built with the noduckdb tag. +func DuckDBOpen(path string) (*sql.DB, error) { + return nil, fmt.Errorf("duckdb_open: duckdb support not compiled (built with noduckdb tag)") +}