Skip to content

Commit

Permalink
Update default protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaslopezf committed Nov 7, 2023
1 parent b565fe0 commit 3f6c363
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/zdb/zdbconnector/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import (
"strings"
)

const (
defaultProtocol = "clickhouse"
)

type ClickHouseConnector struct{}

func (c *ClickHouseConnector) Connect(config *zdbconfig.Config) (*gorm.DB, error) {
Expand All @@ -29,7 +33,7 @@ func (c *ClickHouseConnector) Connect(config *zdbconfig.Config) (*gorm.DB, error
}

func buildClickhouseDSN(params zdbconfig.ConnectionParams) string {
protocol := clickhouse2.Native.String()
protocol := defaultProtocol
if strings.EqualFold(params.Protocol, clickhouse2.HTTP.String()) {
protocol = clickhouse2.HTTP.String()
}
Expand Down

0 comments on commit 3f6c363

Please sign in to comment.