From 48b50a2c82782430fa76eef410946db54f8d186d Mon Sep 17 00:00:00 2001 From: Adam Yeats Date: Fri, 7 Jun 2024 18:10:32 +0100 Subject: [PATCH] Temporarily patch converters to fix support for LowCardinality strings --- pkg/converters/converters.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkg/converters/converters.go b/pkg/converters/converters.go index b65dfd8b..dfb05e10 100644 --- a/pkg/converters/converters.go +++ b/pkg/converters/converters.go @@ -258,6 +258,17 @@ var Converters = map[string]Converter{ matchRegex: matchRegexes["Point"], scanType: reflect.TypeOf((*interface{})(nil)).Elem(), }, + // This is a temporary solution to handle LowCardinality types. + // We'll need to add support for LowCardinality types to `sqlutil` package. + "LowCardinality(String)": { + fieldType: data.FieldTypeString, + scanType: reflect.PointerTo(reflect.TypeOf("")), + }, + "LowCardinality(Nullable(String))": { + fieldType: data.FieldTypeNullableString, + matchRegex: matchRegexes["LowCardinality()"], + scanType: reflect.PointerTo(reflect.PointerTo(reflect.TypeOf(""))), + }, } var ClickhouseConverters = ClickHouseConverters()