My employer is an xAAS and we need to support arbitrary SQL on multiple 
databases. We just need to be able to reliably execute basic CRUD, making 
stored procedure calls, etc., but don't need to worry about creating or 
dropping tables, etc. Someone in the mists of time decided that jOOQ 
(commercial license) would save us some work but since then we've 
substantially re-invented the wheel instead of taking full advantage of 
what jOOQ offers. Part of it is the focus on getting things out the door, 
part of it is relatively junior people having a smaller set of tools 
available than more experienced people so they have a harder time taking a 
step back and asking if this is correct approach instead of just following 
an established pattern. I'm spending a little bit of weekend time looking 
this while trying to learn more about jOOQ as a whole.

One of the two issues is adding support for additional databases. In some 
cases (on the blog) you've said that they're not economically feasible 
since there's so few potential customers (e.g., Teradata), in other cases 
you've said that they're too far from the SQL standards to be a good fit 
(Hive). In our case we're only using a handful of methods so it's not hard 
for us to start with DEFAULT and just tweak the bits we need.

However there's no way to register them with jOOQ - we have to use DEFAULT 
and make the tweaks in various, often ugly, ways. Besides being ugly and 
hard to maintain since one class may have tweaks for multiple unsupported 
databases) it's harder to test since we're working at a much higher 
abstraction layer than Converter, DataType, and Binding.

(It goes without saying that what I'm about to suggest requires a decent 
understanding of the jOOQ internals and things may break in subsequent 
releases. That's a trade-off between whether it will be cheaper for us to 
track the jOOQ changes and make appropriate changes or for us to continue 
doing all of this externally.)

Is it possible to add a few USER_DEFINED entries in SQLDialect? It would be 
us to remember that USER_DEFINED means TERADATA. This would leave slots in 
the caches in DefaultDataType that should go a long way towards providing 
the necessary hooks we need in order to implement our own databases. The 
USER_DEFINED entries would default to DEFAULT.

The alternative is to simply fork the code, add our own entries to 
SQLDialect, and go on from there. We may have to do that anyway for other 
reasons but a couple USER_DEFINED slots would be enough for many people. 
(Assuming they understand the internals well enough to take advantage of 
it, of course.)

Thanks,

Bear

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to