Closed kano5252 closed 1 month ago
Oh, my bad, seems spring-data-relational(version 3.3.3) for Criteria there's a ignoreCase(true) method for this requirement.
after using ignoreCase(true) field like condition will be convert to Upper(field) so no need to set it on connection level.
But InitSql will it help in other cases?
I see r2dbc-pool supports a "postAllocate" function: https://github.com/r2dbc/r2dbc-pool?tab=readme-ov-file#lifecycle-support
Is this what you need?
Hope this was resolved. Otherwise, let me know if I can help.
Is it a good idea to add initSql support for each connection from the pool? which means after creating connection, use this connection to run initSql, and put it into pool, in this case, every connection has run the initSql and ready to use.
Here is the real case: I want to use like search, but the Oracle value is case sensitive, you can't get result with keyword "%smith%" while actual record is "SMITH". Changing server side can solve this, but it cost too much.
also using function like "Upper" convert to upper case isn't fit, due to I'm using spring-r2dbc and spring-data-relational (Criteria and Query....) which doesn't support function on field level.
On connection level, we can use
it works on connection session level, which needs every connection in the pool has run it. so it came up to me with this idea, please kindly advise and if any better solution will be appreciated.