Skip to content

Commit

Permalink
Iterx inherit mapper from Queryx
Browse files Browse the repository at this point in the history
Signed-off-by: Michał Matczuk <[email protected]>
  • Loading branch information
mmatczuk committed Nov 8, 2019
1 parent 1f3032a commit a57d58f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions queryx.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func (q *Queryx) Get(dest interface{}) error {
if q.err != nil {
return q.err
}
return Iter(q.Query).Get(dest)
return q.Iter().Get(dest)
}

// GetRelease calls Get and releases the query, a released query cannot be
Expand All @@ -230,7 +230,7 @@ func (q *Queryx) Select(dest interface{}) error {
if q.err != nil {
return q.err
}
return Iter(q.Query).Select(dest)
return q.Iter().Select(dest)
}

// SelectRelease calls Select and releases the query, a released query cannot be
Expand All @@ -244,5 +244,7 @@ func (q *Queryx) SelectRelease(dest interface{}) error {
// big to be loaded with Select in order to do row by row iteration.
// See Iterx StructScan function.
func (q *Queryx) Iter() *Iterx {
return Iter(q.Query)
i := Iter(q.Query)
i.Mapper = q.Mapper
return i
}

0 comments on commit a57d58f

Please sign in to comment.