Skip to content

Use JdbcConnectionDetails to detect Dialect instead of Environment #294

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

Merged
merged 3 commits into from
Apr 26, 2025

Conversation

making
Copy link
Member

@making making commented Apr 25, 2025

closes gh-286

@making
Copy link
Member Author

making commented Apr 25, 2025

@backpaper0
I support obtaining the URL from JdbcConnectionDetails because I want to automatically detect it from TestContainers and Docker Compose as well.
If JdbcConnectionDetails cannot be obtained, what behavior do you think would be appropriate?
For example, if DataSource is explicitly defined, JdbcConnectionDetails is not generated by AutoConfiguration.
The following options can be considered:

  • Inject DataSourceProperties as an alternative. This prevents errors from occurring, but DataSourceProperties may not hold accurate values in this use case, so an incorrect dialect might be detected.
  • Generate an error and encourage users to explicitly specify doma.dialect. This would be a breaking change, but it might be safer.

@backpaper0
Copy link
Member

@making
Thank you.
I’d prefer the latter option.
As long as we clearly explain a breaking changes in the release notes, it shouldn’t be a problem.

@making making marked this pull request as draft April 25, 2025 04:02
@making making marked this pull request as ready for review April 25, 2025 04:41
@backpaper0 backpaper0 self-requested a review April 26, 2025 06:27
@making making merged commit a8c778c into master Apr 26, 2025
6 checks passed
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.

Prefer JdbcConnectionDetails over Environment for Dialect auto-resolution
2 participants