georgysavva / scany

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

Support sql.DB.QueryRow #116

Closed jsumners closed 1 year ago

jsumners commented 1 year 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 1 year ago

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