Skip to content
This repository was archived by the owner on Apr 16, 2026. It is now read-only.

Commit 57cdbab

Browse files
committed
fix: bootstrap clickhouse schema from default database
1 parent 44cdf11 commit 57cdbab

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

internal/publish/clickhouse.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@ func NewClickHouseSink(ctx context.Context, cfg config.ClickHouseConfig, natsCfg
4848
if strings.TrimSpace(cfg.Addr) == "" {
4949
return nil, nil
5050
}
51+
52+
// Connect to default first so schema bootstrap can create cfg.Database when missing.
5153
conn, err := clickhouse.Open(&clickhouse.Options{
5254
Addr: []string{cfg.Addr},
53-
Auth: clickhouse.Auth{Database: cfg.Database},
55+
Auth: clickhouse.Auth{Database: "default"},
5456
})
5557
if err != nil {
5658
return nil, fmt.Errorf("open clickhouse: %w", err)

0 commit comments

Comments
 (0)