rows: implement driver.RowsColumnScanner on Go 1.27

Go 1.27 added driver.RowsColumnScanner: when a driver implements it, database/sql calls NextRow and ScanColumn instead of Next, so the driver can store a column straight into the Scan destination. With Next, every INTEGER and FLOAT value is boxed into a driver.Value, which allocates once per value outside 0–255.

This MR implements it behind //go:build go1.27, so the module keeps building on Go 1.26:

  • NextRow steps without converting columns.
  • ScanColumn stores INTEGER into *int64/*float64 and FLOAT into *float64/**float64 directly, NULL into **float64 as nil. _inttotime columns are skipped.
  • Every other column type or destination goes through the existing conversion, moved unchanged from Next into rows.value, followed by sql.ConvertAssign, so results and errors are the same as with Next. Next itself now calls rows.value and keeps working for older Go.

BenchmarkScanColumn (10,001 rows of int64, float64, darwin/arm64):

ns/op B/op allocs/op
Next 1,844,000 320,535 30,016
RowsColumnScanner 1,482,000 160,485 10,013

In a real workload (evcc energy history, a GROUP BY over 35k slots scanned into float64 and *float64 fields, linux/arm64) allocations drop from 446k to 175k per query. go test . passes on darwin/arm64 with go1.27.2.

🤖 Generated with Claude Code

Merge request reports

Loading
Loading