Idea: Group query params #4277
Unanswered
LeoCaprile
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.
-
Hey guys
Introduction
I came across the idea of the posibility to group params in separated structs, to facilitate separation of concern in complex queries or just to organize parameters.
Why
I got the idea wanting to separate the params from the
WHEREclause from theSETclause params. see example.How
My idea of implementation is to create a new sqlc function that takes two parameters:
Here's an example of the function signature:
sqlc.group('SearchParams', 'id')Example
Here's an example of a simple use case for the new feature from the sqlc query to the generated code.
Query
Generated code
I could make a PR with the changes if you guys think it's a good idea.
Thanks for reading!
Beta Was this translation helpful? Give feedback.
All reactions