Closed benedictjohannes closed 2 years ago
Hello. You can use ScanOne
or Get
to scan a single row. Scany doesn't work with pgx.Row
type because id doesn't expose all needed information to do the mapping. See this comment https://github.com/georgysavva/scany/issues/28#issuecomment-800717637
I added a corresponding doc section https://github.com/georgysavva/scany/blob/d28f8d85a1bd4b5684e80d79dd3cbab5dce153af/dbscan/doc.go#L195-L199
I've read the source for pgxscan, and I haven't found the package supporting scanning
pgx.Row
(one returned from(p *pgx.Pool) QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row
).Do you plan to add this into the library?
As for now, I've only used the
Scan
orScanRow
functions as opposed to the "higher level" functionSelect
orGet
. Reading further into the dbscan package, it seems to me that the various checks (like checking for no multiple rows) would make adding this implementation non trivial. However, having the single returnpgx.Row
and needing only to check only one error code can save a lot of coding.Thank you in advanced.