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

Missing :name -> NullPointerException #39

Closed
AdamFrey opened this issue Apr 28, 2016 · 2 comments
Closed

Missing :name -> NullPointerException #39

AdamFrey opened this issue Apr 28, 2016 · 2 comments

Comments

@AdamFrey
Copy link

A thing just happened to me where I was writing a query and started in the .sql file with:

-- :name

but I didn't know what I wanted to name my query yet, so I wrote out the query:

-- :name
select * from ...
...

and when I was satisfied with the query I reloaded my code, forgetting to go back and give the query a name. And the result was a NullPointerException. It's kind of a rare case, and didn't take me too long to figure out the problem, but it's a fairly vague error message.

If you are interested in a validation there I can make a patch, but I won't be offended if you aren't interested.

@csummers
Copy link
Member

Good catch! Thanks for the report!

I added a validation exception for this that dumps the corresponding SQL statement for context. This will roll into the next release.

@csummers
Copy link
Member

This is release in 0.4.8 (finally!). Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants