Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: EXPOSED-708 Remove JDBC DatabaseMetaData from exposed-core module #2379

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bog-walk
Copy link
Member

@bog-walk bog-walk commented Jan 29, 2025

Description

Summary of the change: exposed-core no longer uses JDBC DatabaseMetaData to resolve metadata query results into ReferenceOption constants.

Detailed description:

  • Why:

In preparation for R2DBC, all JDBC specific metadata processing must be extracted from the core module. DatabaseDialect.resolveRefOptionFromJdbc() currently relies on JDBC DatabaseMetaData to find a matching ReferenceOption when table constraints are being generated by metadata query results.

  • How:
    • Add new ExposedDatabaseMetadata.resolveReferenceOption() (so that it can be implemented for JDBC now and R2DBC later)
    • Deprecate old DatabaseDialect.resolveRefOptionFromJdbc() and have it call the above.
    • Move dialect specific logic to exposed-jdbc

Type of Change

Please mark the relevant options with an "X":

  • Other: refactor
  • Other: deprecation

Affected databases:

  • All

Checklist

  • The build is green (including the Detekt check)
  • All public methods affected by my PR has up to date API docs

Related Issues

EXPOSED-708
R2DBC parent - EXPOSED-517

- DatabaseDialect has a method resolveRefOptionFromJdbc that finds a ReferenceOption
match for a jdbc-specific enum constant.
- This removes such logic from the core module and leaves it in the jdbc module.
- The new method is labeled as internal as it will need an r2dbc-specific override.
…module

- Undo MySQL change until custom sql extracted from dialect too
@bog-walk bog-walk requested review from e5l and obabichevjb January 29, 2025 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant