Add QueryRow warning to DriverBytes
This commit is contained in:
+3
-2
@@ -16,8 +16,9 @@ type BytesValuer interface {
|
|||||||
BytesValue() ([]byte, error)
|
BytesValue() ([]byte, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// DriverBytes is a byte slice that holds a reference to memory owned by the driver. It is only valid until the next
|
// DriverBytes is a byte slice that holds a reference to memory owned by the driver. It is only valid from the time it
|
||||||
// database method call. e.g. Any call to a Rows or Conn method invalidates the slice.
|
// is scanned until Rows.Next or Rows.Close is called. It is safe to use in a function passed to QueryFunc. It is never
|
||||||
|
// safe to use DriverBytes with QueryRow as Row.Scan internally calls Rows.Close before returning.
|
||||||
type DriverBytes []byte
|
type DriverBytes []byte
|
||||||
|
|
||||||
func (b *DriverBytes) ScanBytes(v []byte) error {
|
func (b *DriverBytes) ScanBytes(v []byte) error {
|
||||||
|
|||||||
Reference in New Issue
Block a user