We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2023/04/26 10:58:22 main.go:32 [error] unsupported data type: &[] Ok
go version: go version go1.20.3 linux/amd64 clickhouse version: 23.3.1.2823 gorm version: [email protected] driver clickhouse: v0.5.1
package main import ( "fmt" "gorm.io/driver/clickhouse" "gorm.io/gorm" ) type User struct { Uniqid string `gorm:"column:uniqid;primaryKey"` Name string `gorm:"column:name"` } func (User) TableName() string { return "user" } func main() { dsn := "clickhouse://gorm:gorm@localhost:9942/gorm?dial_timeout=10s&read_timeout=20s" db, err := gorm.Open(clickhouse.Open(dsn), &gorm.Config{}) if err != nil { panic("failed to connect database") } u := User{ Uniqid: "31502ca1839f3dccd849abdc49e2fa41", Name: "gorm", } err = db.Table("user").Create(&u).Error if err != nil { panic(err) } fmt.Println("Ok") } // Output // 2023/04/26 10:58:22 main.go:32 // [error] unsupported data type: &[] // Ok
The text was updated successfully, but these errors were encountered:
[error] unsupported data type: &[] 这个错误一般是因为model里面定义了一些非基本类型的数据结构,如[]string,map等,涉及到这类的数据结构时,这类的数据结构需要实现GormDataTypeInterface接口,就不会报这类错误了
Sorry, something went wrong.
jinzhu
No branches or pull requests
creare data to clickhouse happen error but data success write to clickhouse
2023/04/26 10:58:22 main.go:32 [error] unsupported data type: &[] Ok
version info
pseudocode:
The text was updated successfully, but these errors were encountered: