Support RowsColumnScanner on Go 1.27 - #649
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #649 +/- ##
=======================================
+ Coverage 89.5% 89.8% +0.2%
=======================================
Files 15 16 +1
Lines 582 599 +17
=======================================
+ Hits 521 538 +17
Misses 61 61 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Owner
Author
|
A related work in driver lib: jackc/pgx#2542 |
XSAM
marked this pull request as ready for review
September 5, 2026 05:57
Record ScanColumn errors on rows spans and cover propagation through database/sql.
Merged
XSAM
added a commit
that referenced
this pull request
Sep 6, 2026
This release is the last to support [Go 1.25]. The next release will require at least [Go 1.26]. ### Added - Support testing of [Go 1.27]. (#650) - Add `WithSpanErrorAttributesGetter` option to set additional attributes (e.g., `db.response.status_code`) on spans when an operation returns an error. (#651) - Add `SpanOptions.RowsChildOfQuery` to create `sql.rows` spans as children of the `sql.conn.query` or `sql.stmt.query` span that produced them, so concurrent queries can be correlated with their result iteration. (#652) - Support `driver.RowsColumnScanner` on [Go 1.27]. (#649) ### Changed - Replace `ErrorTypeAttributes` with `ErrorTypeAttribute` to avoid allocating an additional slice. (#643) - Upgrade OTel to `v1.46.0`. (#644) ### Fixed - `db.client.operation.duration` histogram now uses the explicit bucket boundaries recommended by the OTel Semantic Conventions (`0.001` to `10` seconds) instead of the SDK defaults, which placed virtually all database operations in the first bucket. (#632) [Go 1.26]: https://go.dev/doc/go1.26 [Go 1.25]: https://go.dev/doc/go1.25 [Go 1.27]: https://go.dev/doc/go1.27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Go 1.27 applications can retain driver-owned column scanning when a driver is wrapped by otelsql. This lets drivers such as pgx decode PostgreSQL arrays, ranges, and other custom types directly instead of losing that capability at the instrumentation boundary.
The wrapper exposes
driver.RowsColumnScanneronly when the underlying rows implement it.NextRowcontinues to emit row events, and non-EOF errors from bothNextRowandScanColumnare recorded on thesql.rowsspan.ScanColumnerrors are returned unchanged to the caller. Earlier Go versions keep the ordinary rows wrapper.Fixes #557.
Validation
database/sqlintegration tests verifyScanColumnerror propagation, Error span status, and exception recording.ccd2e56d9941in all five pgx query modes.bigint[],int4range, and thesql.ConvertAssignboolean fallback.sql.rows.nextwithout row-span errors.bigint[]into[]int64, confirming that the integration test detects the missing interface.New concepts
driver.RowsColumnScanneris an optional Go 1.27 interface that lets a SQL driver advance rows withNextRowand scan each column directly into the caller's destination.database/sqlstops calling legacyRows.Nextwhen this interface is present, so a wrapper must preserve it conditionally rather than implement it for every driver.This is useful when decoding depends on driver-specific context. pgx can retain its PostgreSQL type map, OID, wire format, and raw bytes instead of first reducing the value to a generic
driver.Value.Post-Deploy Monitoring & Validation
unsupported Scan,cannot scan, andsql: Scan errorafter adopting the release.sql.rowsspans for Go 1.27 applications.sql.rowserror spans.