querying JSON field #738
-
i have table something like this on postgres
while i know it is bad querying from JSON, but this is legacy data structure, so shit happen let say data on metadata is like this
when i create query
the generated parameters will become like this
So, the question should it type on parameter become |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
The type of the address1 field on the JSON column isn't known at compile time. You're correct that the parameter type should be You probably know the type of address1, so you can always cast it to text:
|
Beta Was this translation helpful? Give feedback.
-
why is it bad to query JSONB? |
Beta Was this translation helpful? Give feedback.
The type of the address1 field on the JSON column isn't known at compile time. You're correct that the parameter type should be
interface{}
instead ofjson.RawMessage
. I've created #743 to track that bug.You probably know the type of address1, so you can always cast it to text: