Now for a longer reply
I've spent some time trying to link Flyway and JOOQ so that it looks clean
and 'right' and below are just some comments about what does not look
'right' rather than there being any real issues.
Flyway
So far the only real issue I have found is that Flyway's design is that of
a two step process, first get a checksum value for the migration step and
then if needed process the migration or report an issue if the checksum is
not the same as already recorded. This works well if the DDL is static as
you can just checksum the script file. It does not work so well if there is
a programmatic process to be followed as the process has to generate a
checksum from a trial run. The work around is for the trial run to be
started from within the checksum routine, while a valid solution it does
mean that Flyway is not fully in control of the 'life cycle', but its a
minor issue.
JOOQ
The fun starts if you wish to maintain JOOQ's fluent interface as there is
a need to 2 things that I doubt anyone has asked for before
- The ability to conditionally execute a modeled SQL statement (in this
case DDL) so that things like the hashCode can be correctly generated for
the checksum step.
- Return additional information from within the single fluent structure.
(if that is even the correct term)
As a concrete example consider the following 'idea'
create.createTable("tableName")
.column("first", SQLDataType.BIT)
.column("second", SQLDataType.TINYINT)
.hashCode(hashResult) //
place the hash into an object (pass by ref workaround)
.getSQL(sqlResult)
// place the SQL String into an object (pass by ref workaround)
.execute(condition);
// execute only if the condition is true
While I would say that such changes to JOOQ would provide an elegant for
the particular use case, I doubt the additional overall complexity to JOOQ
is worth while as the same can be handled by breaking things down into a
number of statements using CreateTableAsStep, CreateTableColumnStep and an
if to control execution.
--
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.