Before I create 20 feature requests, I’ll better ask the forums first
For the jOOQ <-> Liquibase integration attempts, I’d like to be able to navigate between Liquibase meta model objects in any direction. From what I understand, the DatabaseSnapshot is a good entry point in client code, to get a hold of various DatabaseObjects.
However, I’m missing a couple of links, symbolically listed as method declarations (replace arrays with lists, if you prefer):
- class Table {
- PrimaryKey getPrimaryKey();
- UniqueConstraint[] getUniqueConstraints();
- UniqueConstraint getUniqueConstraint(String name);
- ForeignKey[] getForeignKeys();
- ForeignKey getForeignKey();
- }
And then
- // Primary keys are "special" unique constraints. Coupling them more tightly would add some
- // expressiveness to the meta API
- class PrimaryKey extends UniqueConstraint {
- }
And
- class ForeignKey {
- // This could be a PrimaryKey...
- UniqueConstraint getReferencedConstraint();
- }
Also, I’m not quite sure about the usefulness of the Schema object. How about adding:
- class Schema {
- Table[] getTables();
- View[] getViews();
- Sequence[] getSequences();
- UniqueConstraint[] getUniqueConstraints();
- PrimaryKey[] getPrimaryKeys();
- ForeignKey[] getForeignKeys();
- }
Let me know what you think