Idiomatic approach to UpdateIfExists conditions using sqlc #2010
Answered
by
kumarankitapp
kumarankitapp
asked this question in
Q&A
|
DB: Mysql Use case: What I am trying to do is use INSERT INTO ON DUPLICATE KEY as below When I run sqlc generate on my query, the params struct, and the corresponding method creates a duplicate value field with _2 naming convention. Eg: Is there a right way to create a query as such or should break these into 2 separate queries ( INSERT INTO >> check for duplicate key error >> if err then as a response UPDATE) I cannot use INSERT IGNORE or REPLACE INTO for my use case. |
Answered by
kumarankitapp
Dec 30, 2022
Replies: 1 comment
|
welp, just read on named parameters. Got the issue resolved. |
0 replies
Answer selected by
kumarankitapp
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
welp, just read on named parameters. Got the issue resolved.