pointer to struct when using jsonb #3189
Unanswered
nicolasparada
asked this question in
Q&A
Replies: 0 comments
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.
-
Let's say I have this schema:
I configured sqlc to use a custom struct for the
pipelines.config JSONB
.I was able to do it using this config:
All great, the generated model uses my struct.
My problem comes down when I write an
UPDATE
query with an optional argument like so:I was hoping the generated update params to use a pointer, but it doesn't.
I can go to the sqlc config and do this:
And that generates a pointer on the update params, but it also generates a pointer for the model.
I want the model to not use a pointer, only on the update params. Is there a way to do it?
Note: I know I could write the query differently to overcome this. Maybe something like:
But since I'm able to use proper pointers for other primitive types when using
sqlc.narg()
I would like to stick to using pointers.Beta Was this translation helpful? Give feedback.
All reactions