Scan joined query to embedded struct #1799
Unanswered
omi-donlimit
asked this question in
Q&A
Replies: 1 comment
-
It seems that making the struct: type B struct {
ID pgtype.Int4 `db:"id"`
A A //this
} removes the error. I have yet to make it work fully still ( |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, how does one solve this kind of problem (example):
SQL:
the sql works if i use it in psql, but in Go/PGX i get
QueryRow failed: cannot find field xxxx in returned row
I can use
pgx.CollectOneRow(rows, pgx.RowToAddrOfStructByName[B])
to easily bind toB
, but how to handle embedded?Beta Was this translation helpful? Give feedback.
All reactions