schemacrawler / SchemaCrawler

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

Avoid storing lints in catalog #1750

Open bekoenig opened 2 hours ago

bekoenig commented 2 hours ago

Description

Calling Linters#lint from java is confusing. In first expectation this method should returns all founded lints. But this method has a side effect in which all lints are stored in the catalog root and each table. So the caller has to replicate the object key (private constant), get all lints from the nodes and reset the catalog to get the original state.

How to Reproduce

No response

Relevant log output

No response

SchemaCrawler Version

16.22.3

Java Version

21

Operating System and Version

Win 10

Relational Database System and Version

DB2LUW 11.5

JDBC Driver and Version

current

bekoenig commented 2 hours ago

I use this method in my new test extension (will be open sourced in the next few months) to check for new lints after each flyway migration. So I remove all known lints from the new result to get the difference. My current solution has some boilerplate and produces footprints at the catalog instance which I don't like as the catalog is also used for asserts with assertj-schemacrawler to check the schema changes after migration.