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

sqlc.(n?)arg panics when 0 arguments are passed in #1632

Closed
ryan-berger opened this issue May 19, 2022 · 0 comments · Fixed by #1633
Closed

sqlc.(n?)arg panics when 0 arguments are passed in #1632

ryan-berger opened this issue May 19, 2022 · 0 comments · Fixed by #1633
Labels
bug Something isn't working triage New issues that hasn't been reviewed

Comments

@ryan-berger
Copy link
Contributor

Version

1.13.0

What happened?

I accidentally passed 0 arguments into sqlc.narg and received the following panic:

goroutine 1 [running]:
github.com/kyleconroy/sqlc/internal/sql/validate.ParamStyle({...., ......})

Which comes from this line:

https://github.com/kyleconroy/sqlc/blob/c2dcd56a5d8b2a3b2fa9c7f6545d0b1d5555be29/internal/sql/validate/param_style.go#L19

Although this is invalid input, it would be nice to have an error message printed out.

Relevant log output

No response

Database schema

No response

SQL queries

No response

Configuration

No response

Playground URL

No response

What operating system are you using?

Linux

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

@ryan-berger ryan-berger added bug Something isn't working triage New issues that hasn't been reviewed labels May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage New issues that hasn't been reviewed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant