2
0

Add RawValues to Rows

This commit is contained in:
Jack Christensen
2019-09-10 17:58:24 -05:00
parent 4952a488f2
commit a8691a7066
3 changed files with 48 additions and 1 deletions
+9 -1
View File
@@ -40,8 +40,12 @@ type Rows interface {
// copy the raw bytes received from PostgreSQL. nil will skip the value entirely.
Scan(dest ...interface{}) error
// Values returns an array of the row values
// Values returns the decoded row values.
Values() ([]interface{}, error)
// RawValues returns the unparsed bytes of the row values. The returned [][]byte is only valid until the next Next
// call or the Rows is closed. However, the underlying byte data is safe to retain a reference to and mutate.
RawValues() [][]byte
}
// Row is a convenience wrapper over Rows that is returned by QueryRow.
@@ -249,6 +253,10 @@ func (rows *connRows) Values() ([]interface{}, error) {
return values, rows.Err()
}
func (rows *connRows) RawValues() [][]byte {
return rows.resultReader.Values()
}
type scanArgError struct {
col int
err error