gorm
gorm copied to clipboard
Support go1.23 iterators
Describe the feature
Allow to pass iterators in methods:
db.Delete(&User, "name IN (?)", maps.Keys(namesToIDs))
users := []User{{Name: "jinzhu1"}, {Name: "jinzhu2"}, {Name: "jinzhu3"}}
err = db.Create(slices.Values(users)).Error
not it returns errors:
panic: failed to encode args[0]: unable to encode (iter.Seq[string])(0x102f20cf0) into text format for text (OID 25): cannot find encode plan
or
panic: unsupported data type: iter.Seq[main.Test]: Table not set, please set it like: db.Model(&user) or db.Table("users")
Motivation
Support new go standard library features.