Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions structable.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ type WhereFunc func(desc Describer, query squirrel.SelectBuilder) (squirrel.Sele
// of each matches the underlying type of the passed-in 'd' Recorder.
func ListWhere(d Recorder, fn WhereFunc) ([]Recorder, error) {
var tn string = d.TableName()
var cols []string = d.Columns(false)
var cols []string = d.Columns(true)
buf := []Recorder{}

// Base query
Expand Down Expand Up @@ -338,7 +338,11 @@ func ListWhere(d Recorder, fn WhereFunc) ([]Recorder, error) {
s := nv.Interface().(Recorder)
s.Init(d.DB(), d.Driver())
dest := s.FieldReferences(true)
rows.Scan(dest...)

if err := rows.Scan(dest...); err != nil {
return buf, err
}

buf = append(buf, s)
}

Expand Down