-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add JDBC custom credential support for postgres #1293
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only have some trivial style suggestions, but otherwise this is great. Thank you very much!
modules/jdbc-test/src/test/java/org/testcontainers/jdbc/JDBCDriverTest.java
Outdated
Show resolved
Hide resolved
rs.next(); | ||
String resultUser = rs.getString(1); | ||
assertEquals("User from query param is created.", "someuser@%", resultUser); | ||
// Not all databases (eg. Postgres) return @% at the end of user name. We just need to make sure the user name matches. | ||
if(resultUser.endsWith("@%")) resultUser = resultUser.substring(0, resultUser.length() - 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(resultUser.endsWith("@%")) resultUser = resultUser.substring(0, resultUser.length() - 2); | |
if (resultUser.endsWith("@%")) { | |
resultUser = resultUser.substring(0, resultUser.length() - 2); | |
} |
Just a small style change.
modules/jdbc-test/src/test/java/org/testcontainers/jdbc/JDBCDriverTest.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only have some trivial style suggestions, but otherwise this is great. Thank you very much!
Thanks for the review @rnorth . I have formatted the code in the latest commit. Please check when you get a chance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great for me, thanks!
Thanks @manikmagar! |
Releasing this in 1.11.0 🎉 |
This PR adds custom username and password support for Postgres. It refactors the function in MySQL and MariaDB drivers to reuse. This is based on #617 .