The Wayback Machine - https://web.archive.org/web/20220326183728/https://github.com/kyleconroy/sqlc/issues/1498
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure positional parameter logic #1498

Open
kyleconroy opened this issue Mar 19, 2022 · 1 comment
Open

Configure positional parameter logic #1498

kyleconroy opened this issue Mar 19, 2022 · 1 comment
Labels
enhancement good first issue

Comments

@kyleconroy
Copy link
Owner

@kyleconroy kyleconroy commented Mar 19, 2022

What do you want to change?

For Go, sqlc will use a positional argument for a query if there's a single parameter. If there's more than one, it will generate a parameters struct. While this works for me, a few other folks would like different behavior.

@brentd would like to use positional arguments for up to three parameters (#1496)
@Threpio would like to always use parameter structs (#1373)

How should we do it?

We can solve this using a single configuration parameter called query_parameter_limit, which defaults to 1 (the current behavior). We'll need to be document that setting it to zero is invalid; to always emit a struct, you'd need to set it to -1.

What programming language backends need to be changed?

Go

@iAziz786
Copy link

@iAziz786 iAziz786 commented Mar 19, 2022

I am very new to sqlc, given I put some research in it I would like to pick this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue
2 participants