Skip to content

Support SQUARE brackets [] around NAMED parameter #27716

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

Merged
merged 1 commit into from
Dec 14, 2021

Conversation

AntonLGVS
Copy link
Contributor

At the moment, if sql statement has a variable in square brackets, then the name of the variable will be incorrect.
For example:
SELECT ARRAY[:ext];
We'll get "ext]" instead of "ext".

But:
SELECT ARRAY[:ext ]; --with white space
We'll get "ext".

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 22, 2021
@rstoyanchev rstoyanchev added the in: data Issues in data modules (jdbc, orm, oxm, tx) label Nov 24, 2021
@rstoyanchev rstoyanchev added this to the Triage Queue milestone Nov 24, 2021
@schauder
Copy link
Contributor

I agree with the OP. This makes sense for the array syntax at least of Postgres and DB2. It might even be the standard, but I don't know.

We should probably also make sure that expansion of collections into a comma separated list happens, so that this works when ext isn't just a singular argument but a collection of things, which would make sense for arrays.

An alternative workaround is to pass in a java.sql.Array directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants