jooq codegen sort ordering inconsistencies

10 views
Skip to first unread message

Kai Waldron

unread,
Jun 19, 2017, 2:53:25 PM6/19/17
to jOOQ User Group
Hello,

Wondering about the best ways to potentially tackle this issue. Running jooq codegen against the same Postgres db running on Mac and Linux (identical schema) produces slightly different results. Different in the order stored procedures are generated in the Routines.java file, for example. Digging into this it appears to be a known issue related to the way OS X and Linux variants handle collation differently. For example see: https://simply.name/pg-lc-collate.html

So, I'm wondering what the best work around is to get a consistent ordering across OSs here? Is there a way I can define my own ordering function for jooq codegen?

Cheers,
Kai

Lukas Eder

unread,
Jun 19, 2017, 3:09:10 PM6/19/17
to jooq...@googlegroups.com
Interesting, thanks for pointing this out.

The quickest solutions here would be:

- Patch org.jooq.util.postgres.PostgresDatabase to run a more appropriate query in getRoutines0()
- Override getRoutines0() and sort the resulting List<RoutineDefinition> using Java
- Wait for jOOQ 3.10, where we introduced a new <orderProvider/> SPI to the code generator, which fixes this configuratively: https://github.com/jOOQ/jOOQ/issues/4846

I hope this helps,
Lukas

--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages