Hello Lukas,
In our Oracle->PG migration, we are using JOOQ's ParsingConnection to translate between dialects.
Similar to
https://github.com/jOOQ/jOOQ/issues/11757, we are facing issues with Oracle's NULL and empty string equivalence.
The assumption is prelevant across the codebase as we have a lot of code that expects setString('', i) to be nullified.
This is especially problematic when done on FK columns, as pg would complain for violating it (otherwise I wouldn't have found out about this haha).
The first straight-forward solution on our side is to add empty checks everywhere, but I am trying to avoid this path for obvious reasons.
I wonder if JOOQ could do something about this, or if there is an equivalent to ParseListener for binding that would allow more flexibility in that area.
jooq version : 3.19.6
target sql dialect : POSTGRES_12
settings :
Settings settings = new Settings()
.withParseDialect(SQLDialect.ORACLE)
.withParseUnknownFunctions(ParseUnknownFunctions.IGNORE)
.withTransformTableListsToAnsiJoin(true) // transform (+) to left outer join
.withTransformUnneededArithmeticExpressions(TransformUnneededArithmeticExpressions.ALWAYS)
.withTransformRownum(Transformation.ALWAYS)
.withParamType(ParamType.INLINED)
.withParamCastMode(ParamCastMode.DEFAULT)
.withRenderOptionalAsKeywordForFieldAliases(RenderOptionalKeyword.ON)
.withRenderOptionalAsKeywordForTableAliases(RenderOptionalKeyword.ON)
.withRenderQuotedNames(RenderQuotedNames.EXPLICIT_DEFAULT_UNQUOTED)
.withRenderNameCase(RenderNameCase.UPPER)
.withRenderCoalesceToEmptyStringInConcat(true);