Closed jsumners closed 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.
sql.DB.Query
sql.Rows
sql.Row
sqlscan.ScanOne
Rows
sqlscan.ScanOneRow
sql.DB.QueryRow
https://github.com/georgysavva/scany/blob/958ed3c474957cf4f14d5151ce5348eb86710560/dbscan/doc.go#L195-L201
https://pkg.go.dev/database/sql#DB.QueryRow
Unlike
sql.DB.Query
, which returns a slice ofsql.Rows
, this method returns a singularsql.Row
. However,sqlscan.ScanOne
expects the slice ofRows
. It would be nice if there were a function likesqlscan.ScanOneRow
that pairs withsql.DB.QueryRow
.