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
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.
/* name: List :many */
SELECT * FROM some_table WHERE col_1 = ?? AND col_2 = ?? AND col_3 = ??
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
-
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