Merge caller JDBC Properties in createConnection#11773
Open
singhvishalkr wants to merge 1 commit intotestcontainers:mainfrom
Open
Merge caller JDBC Properties in createConnection#11773singhvishalkr wants to merge 1 commit intotestcontainers:mainfrom
singhvishalkr wants to merge 1 commit intotestcontainers:mainfrom
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
ca2d159 to
304150d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of your change?
Hikari and other pools pass URL-level options through the \info\ map on \Driver.connect. Those entries must show up on the same \Properties\ instance we hand to the delegate driver, together with the container username and password.
Using
ew Properties(info)\ keeps caller keys on the defaults list. Drivers that only inspect the primary map (or build cache keys from \stringPropertyNames()\ without merging defaults the way you expect) effectively drop those options.
How does it work?
Start from an empty \Properties, \putAll\ the caller map when \info\ is non-null, then put \user\ and \password\ as today. Added a unit test with a mock \Driver\ that asserts a sample caller key is present in \stringPropertyNames()\ after the merge.
Fixes #1537.
Note: I could not run ./gradlew spotlessApply\ locally (no JDK in this environment). Please rely on CI for Spotless and the jdbc test task.
Made with Cursor