Skip to content

Support go1.23 iterators #7192

@ilya-hontarau

Description

@ilya-hontarau

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

Now 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.

Related Issues

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions