From 3f6c363ba5c6917b72a942040edef658eced23e7 Mon Sep 17 00:00:00 2001 From: Lucas Francisco Lopez Date: Tue, 7 Nov 2023 15:14:07 +0100 Subject: [PATCH] Update default protocol --- pkg/zdb/zdbconnector/clickhouse.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/zdb/zdbconnector/clickhouse.go b/pkg/zdb/zdbconnector/clickhouse.go index a4c95a4..baa7867 100644 --- a/pkg/zdb/zdbconnector/clickhouse.go +++ b/pkg/zdb/zdbconnector/clickhouse.go @@ -11,6 +11,10 @@ import ( "strings" ) +const ( + defaultProtocol = "clickhouse" +) + type ClickHouseConnector struct{} func (c *ClickHouseConnector) Connect(config *zdbconfig.Config) (*gorm.DB, error) { @@ -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() }