georgysavva / scany

Library for scanning data from a database into Go structs and more
MIT License
1.23k stars 67 forks source link

Support sql.DB.QueryRow #116

Closed jsumners closed 9 months ago

jsumners commented 9 months ago

https://pkg.go.dev/database/sql#DB.QueryRow

Unlike sql.DB.Query, which returns a slice of sql.Rows, this method returns a singular sql.Row. However, sqlscan.ScanOne expects the slice of Rows. It would be nice if there were a function like sqlscan.ScanOneRow that pairs with sql.DB.QueryRow.

jsumners commented 9 months ago

https://github.com/georgysavva/scany/blob/958ed3c474957cf4f14d5151ce5348eb86710560/dbscan/doc.go#L195-L201