You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
UPDATE pipelines SET
config = (
CASE WHEN @set_config::bool
THEN @config::jsonb
ELSE config
END
)
WHERE id = @pipeline_id;
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.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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