Skip to content

Commit

Permalink
add Kind() method to convert *Rows to pgx.Rows interface
Browse files Browse the repository at this point in the history
  • Loading branch information
labi-le committed Nov 1, 2023
1 parent 5e0d622 commit b501ed2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rows.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,14 @@ func (r *Rows) FromCSVString(s string) *Rows {
return r
}

// Kind returns rows corresponding to the interface pgx.Rows
// useful for testing entities that implement an interface pgx.RowScanner
func (r *Rows) Kind() pgx.Rows {
return &rowSets{
sets: []*Rows{r},
}
}

// NewRowsWithColumnDefinition return rows with columns metadata
func NewRowsWithColumnDefinition(columns ...pgconn.FieldDescription) *Rows {
return &Rows{
Expand Down

0 comments on commit b501ed2

Please sign in to comment.