I currently use this code with JOOQ:
Condition condition = DSL.trueCondition();
if( isNotBlank(email) ){
condition = condition.and(APP_USER.EMAIL.likeRegex(email));
}
That ends up issuing Postgres specific SQL that does the regex match in the DB:
app_user.email ~ '{email regex}'
Is it possible to get JOOQ to issue the case insensitive version: app_user.email ~* '{email regex}'?
My current workaround is to use this code:
if( isNotBlank(email) ){
condition = condition.and(
APP_USER.EMAIL.lower().likeRegex(email.toLowerCase()) );
}