code
var dataList []any
m1 := model.Province{}
m1.Code = 65
m1.Name = "新疆维吾尔自治区"
dataList = append(dataList, m1)
m2 := model.Province{}
m2.Code = 41
m2.Name = "河南省"
dataList = append(dataList, m2)
bootstrap.Db.Create(dataList)
err msg
Table not set, please set it like: db.Model(&user) or db.Table("users")
end
Can you support the above writing method?
Comment From: github-actions[bot]
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking ✨
Comment From: a631807682
Not supported, you can support it yourself via Scanner/Valuer
https://gorm.io/docs/data_types.html#Implements-Customized-Data-Type
Comment From: github-actions[bot]
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking ✨
Comment From: zhanghzong
Is there any consideration or support for this feature in the later stage?
Comment From: github-actions[bot]
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking ✨
Comment From: a631807682
This feat will not be supported. First, you can implement it by yourself. Second, any can have multiple layers of wrap. It does not make much sense to guess the model used by recursive unwrap.