Skip to content

Support SQUARE brackets [] around NAMED parameter - #27716

Merged
jhoeller merged 1 commit into
spring-projects:mainfrom
AntonLGVS:main_square_brackets
Dec 14, 2021
Merged

jhoeller merged 1 commit into
spring-projects:mainfrom
AntonLGVS:main_square_brackets

Conversation

@AntonLGVS

Copy link
Copy Markdown
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
Copy Markdown
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