|
|
|
|
|
|
Make the Schema tooling (export, update, etc) all start with a {{ Database }} object and iterate over its catalog/schema combos and then over tables and sequences within each catalog/schema. In pseudo-code:
{code} for ( Schema classes extendable by extracting interfaces schema : database . This allows getSchemas() ) { for the creation of wrapper classes for example ( Table table : schema . getTables() ) { ... do stuff In my case I need } } {code}
Would be great to be able to filter the tables that are used apply filtering over this process, e.g.: {code} for ( Schema schema operations : I only want to run create and drop operations database.getSchemas() ) { if ( !filter.include( schema ) ) { continue; }
for tables that start with a specific prefix ( Table table : schema . I implemented this by creating a FilteredMetadata, FilteredDatabase and FilteredSchema that delegate all calls to the regular implementation, except that getTables() ) { if ( !filter.include( table ) ) { continue; } ... do stuff } } {code}
or: {code} for ( Schema schema : filter . getTables matches ( database.getSchemas( ) only returns the tables that satisfy the ) ) { for ( Table table : filter. matches( schema.getTables() ) ) { ... do stuff } } {code}
|
|
|
|
|
|