Generic queries with optional params #762
Unanswered
rossb83
asked this question in
Feature Requests & Ideas
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.
-
cc @alecbz
I was thinking it would be neat if there were a way to make a query like this generic with optional params. In the notation below I'm using double question mark
??
to denote an optional param.where the generated go struct took in pointers
in the above query, 8 queries would actually be generated
and the generated go method would re-route to the proper query based on the combination of nil values.
Does this fall in line with the goals of
sqlc
and how complex would this be to implement and work with the current functionality?Beta Was this translation helpful? Give feedback.
All reactions