Skip to content

Commit

Permalink
fix: used proper types for clickhouse arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
alipourhabibi committed Dec 10, 2023
1 parent c36ac14 commit e2c49bb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -911,16 +911,16 @@ func (b *ORMBuilder) parseBasicFields(msg *protogen.Message, g *protogen.Generat
} else if b.dbEngine == ENGINE_CLICKHOUSE && b.IsAbleToMakePQArray(fieldType) && field.Desc.IsList() {
switch fieldType {
case "bool":
fieldType = generateImport("BoolArray", pqImport, g)
fieldType = "[]bool"
gormOptions.Tag = tagWithType(tag, "Array(Bool)")
case "double":
fieldType = generateImport("Float64Array", pqImport, g)
fieldType = "[]float64"
gormOptions.Tag = tagWithType(tag, "Array(Double)")
case "int64":
fieldType = generateImport("Int64Array", pqImport, g)
fieldType = "[]int64"
gormOptions.Tag = tagWithType(tag, "Array(Int64)")
case "string":
fieldType = generateImport("StringArray", pqImport, g)
fieldType = "[]string"
gormOptions.Tag = tagWithType(tag, "Array(String)")
default:
continue
Expand Down

0 comments on commit e2c49bb

Please sign in to comment.