Skip to content

Commit

Permalink
Merge pull request jmoiron#387 from cemremengu/master
Browse files Browse the repository at this point in the history
Added ColumnTypes support
  • Loading branch information
jmoiron authored Feb 28, 2018
2 parents 9adbc06 + 5d28545 commit 7cbed6a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sqlx.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,14 @@ func (r *Row) Columns() ([]string, error) {
return r.rows.Columns()
}

// ColumnTypes returns the underlying sql.Rows.ColumnTypes(), or the deferred error
func (r *Row) ColumnTypes() ([]*sql.ColumnType, error) {
if r.err != nil {
return []*sql.ColumnType{}, r.err
}
return r.rows.ColumnTypes()
}

// Err returns the error encountered while scanning.
func (r *Row) Err() error {
return r.err
Expand Down

0 comments on commit 7cbed6a

Please sign in to comment.