Skip to content

Commit 7cbed6a

Browse files
authored
Merge pull request jmoiron#387 from cemremengu/master
Added ColumnTypes support
2 parents 9adbc06 + 5d28545 commit 7cbed6a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sqlx.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,14 @@ func (r *Row) Columns() ([]string, error) {
228228
return r.rows.Columns()
229229
}
230230

231+
// ColumnTypes returns the underlying sql.Rows.ColumnTypes(), or the deferred error
232+
func (r *Row) ColumnTypes() ([]*sql.ColumnType, error) {
233+
if r.err != nil {
234+
return []*sql.ColumnType{}, r.err
235+
}
236+
return r.rows.ColumnTypes()
237+
}
238+
231239
// Err returns the error encountered while scanning.
232240
func (r *Row) Err() error {
233241
return r.err

0 commit comments

Comments
 (0)