schemacrawler / SchemaCrawler

Free database schema discovery and comprehension tool
http://www.schemacrawler.com/
Other
1.62k stars 200 forks source link

Java Schema Crawler for Oracle not respecting portable names #1293

Closed ice1080 closed 1 year ago

ice1080 commented 1 year ago

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

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

sualeh commented 1 year ago

@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.