feat: build tags y stubs para clickhouse y duckdb
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) <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
//go:build !noclickhouse
|
||||||
|
|
||||||
package infra
|
package infra
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -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)")
|
||||||
|
}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
//go:build !noduckdb
|
||||||
|
|
||||||
package infra
|
package infra
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -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)")
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user