type User struct {
ID string
FirstName string
LastName string
}
sqlQuery := "SELECT id, first_name, last_name FROM users WHERE id = $1"
var user User
err := pgxscan.Get(ctx, db, &user, sqlQuery, "1234")
Error: "scanning one: scanning: doing scan: scanFn: scany: scan row into struct fields: number of field descriptions must equal number of destinations, got 3 and 1"
This same code wasn't causing issues with pgx v4 and scany v1. Am I missing anything?
Error: "scanning one: scanning: doing scan: scanFn: scany: scan row into struct fields: number of field descriptions must equal number of destinations, got 3 and 1"
This same code wasn't causing issues with
pgx v4
andscany v1
. Am I missing anything?