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
Support '.' and '-' as characters in named parameters #2481
Conversation
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Hey! I think this PR just destroyed reading input parameter json (jdbi version 3.41.1):
resulting in an error
Is it intentional? |
Thank you for reporting this regression. @hgschmie , do we need to revert this change? |
Or, maybe it would be sufficient to allow |
A regression was highlighted that the change in 3.41.2 swallowed `-` characters at the end of named parameters and break expressions such as `:foo->>'stuff'`. - Rework the grammar to not support `-` as the last character. - Align the HashStatementLexer to the ColonStatementLexer - Add tests This addresses jdbi#2481 (comment)
@gokristian #2499 should fix this. I plan to release a 3.41.3 around this regression. |
A regression was highlighted that the change in 3.41.2 swallowed `-` characters at the end of named parameters and break expressions such as `:foo->>'stuff'`. - Rework the grammar to not support `-` as the last character. - Align the HashStatementLexer to the ColonStatementLexer - Add tests This addresses jdbi#2481 (comment)
I changed the grammar to match the old version and not accept |
@gokristian again, thank you for reporting the regression. Please try with 3.41.3, this fixes the problem. |
@hgschmie No problem, thank you for fixing it. 3.41.3 works great with param json field accessor! |
This hopefully addresses all the issues raised in jdbi#2481, jdbi#2499 and finally jdbi#2510. The case of the trailing '-' is not solvable without a trailing delimiter. There is not enough information to decide whether `:foo-bar` is "identifier 'foo-bar'" or "identifier 'foo' minus bar". This PR drops the '-' again as a valid character in a parameter or binding (sorry if you added it; but then again this was only added in 3.41.1). The dot (`.`) is still supported as a valid character in a binding or parameter name. It always was for the parameters but not for a binding (this caused the original jdbi#2481 issue).
This hopefully addresses all the issues raised in jdbi#2481, jdbi#2499 and finally jdbi#2510. The case of the trailing '-' is not solvable without a trailing delimiter. There is not enough information to decide whether `:foo-bar` is "identifier 'foo-bar'" or "identifier 'foo' minus bar". This PR drops the '-' again as a valid character in a parameter or binding (sorry if you added it; but then again this was only added in 3.41.1). The dot (`.`) is still supported as a valid character in a binding or parameter name. It always was for the parameters but not for a binding (this caused the original jdbi#2481 issue).
Fixes #2471