Java Schema Crawler for Oracle not respecting portable names
ice1080 opened this issue · 1 comments
Description
Hello!
I'm working with oracle dbs and schemas, and using the schemacrawler-diff
example, along with the java-object-diff
library. I've setup my config to set portableNames using the SchemaTextOptionsBuilder, but when I do a diff, every table is different even with a schema info level of minimum, just comparing the table names.
Config config = SchemaTextOptionsBuilder.builder()
.portableNames()
.noRemarks()
.noInfo()
.toConfig()
Catalog catalog = SchemaCrawlerUtility.getCatalog(databaseConnectionSource, retrievalOptions, options, config)
Do I have my configs wrong or is portableNames()
not working correctly for oracle schemas?
Happy to provide any other info as needed
How to Reproduce
- 2 oracle schemas with different schema names (can be same db)
- create a catalog for both
- use the schemacrawler-diff DiffTest.java to compare the 2 catalogs, note that every table is changed even if the names are the same, because the schema names are different
Relevant log output
Example output:
/tables[SCHEMAVALID_SCHEMA.TABLE_1] (ADDED)
/tables[SCHEMAVALID_SCHEMA.TABLE_2] (ADDED)
/tables[BASE_SCHEMA.TABLE_1] (REMOVED)
/tables[BASE_SCHEMA.TABLE_2] (REMOVED)
SchemaCrawler Version
16.20.4
Java Version
17.0.3 (Adoptium)
Operating System and Version
Linux Pop!_OS version 22.04 LTS (ubuntu debian based)
Relational Database System and Version
Oracle 19.3.0.0
JDBC Driver and Version
com.oracle.database.jdbc:ojdbc10:19.3.0.0
@ice1080 Portable names only affects the textual output, and that is why it is an option on the schema text options. Internally, the metadata objects still retain the complete metadata information.
Also, the schemacrawler-diff project is not supported. It is a demo only. Please see if you can omit the schema names from the diff by looking at SQiShER/java-object-diff. This library has not been updated in a long time! Another approach is to build your own POJO's with only the metadata that you need to compare, and then diff those.