aboutsummaryrefslogtreecommitdiff
path: root/src/database/sql/driver
diff options
context:
space:
mode:
Diffstat (limited to 'src/database/sql/driver')
-rw-r--r--src/database/sql/driver/driver.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/database/sql/driver/driver.go b/src/database/sql/driver/driver.go
index d0892e80fc..487870be63 100644
--- a/src/database/sql/driver/driver.go
+++ b/src/database/sql/driver/driver.go
@@ -515,6 +515,18 @@ type RowsColumnTypePrecisionScale interface {
ColumnTypePrecisionScale(index int) (precision, scale int64, ok bool)
}
+// RowsColumnScanner may be implemented by [Rows]. It allows the driver to completely
+// take responsibility for how values are scanned and replace the normal [database/sql].
+// scanning path. This allows drivers to directly support types that do not implement
+// [database/sql.Scanner].
+type RowsColumnScanner interface {
+ Rows
+
+ // ScanColumn copies the column in the current row into the value pointed at by
+ // dest. It returns [ErrSkip] to fall back to the normal [database/sql] scanning path.
+ ScanColumn(dest any, index int) error
+}
+
// Tx is a transaction.
type Tx interface {
Commit() error