Skip to content

Commit

Permalink
Support getting the database column type names on query results (segm…
Browse files Browse the repository at this point in the history
…entio#1)

* Support getting the database column type names on query results

* Don't use named return for ColumnTypeDatabaseTypeName method
  • Loading branch information
sirwart authored and tejasmanohar committed Dec 28, 2017
1 parent 97a3457 commit 248b74d
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 @@ -46,6 +46,14 @@ func (r *rows) Columns() []string {
return columns
}

func (r *rows) ColumnTypeDatabaseTypeName(index int) string {
colInfo := r.out.ResultSet.ResultSetMetadata.ColumnInfo[index]
if colInfo.Type != nil {
return *colInfo.Type
}
return ""
}

func (r *rows) Next(dest []driver.Value) error {
if r.done {
return io.EOF
Expand Down

0 comments on commit 248b74d

Please sign in to comment.