-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
[Multi-Database Support] Introduce h2 postgre profile properties to let user config database config #4766
[Multi-Database Support] Introduce h2 postgre profile properties to let user config database config #4766
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4766 +/- ##
============================================
- Coverage 47.26% 47.21% -0.05%
- Complexity 1657 1658 +1
============================================
Files 346 346
Lines 10683 10683
Branches 1063 1063
============================================
- Hits 5049 5044 -5
- Misses 5328 5331 +3
- Partials 306 308 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
6a82605
to
b15465c
Compare
It looks like the content is the same among h2/postgres/mysql, I'm thinking if it's possible to leave the datasource config in application-github.properties and config database specific properties in application-mysql.properties/application-h2.properties/application-postgres.properties? |
@nobodyiam Yes we can, But that would require udpated users add a mysql profile.
|
I have given some thoughts on this and here are my suggestions.
# DataSource
spring.datasource.url = ${spring_datasource_url}
spring.datasource.username = ${spring_datasource_username}
spring.datasource.password = ${spring_datasource_password} However, other configurations like init sql could be different for different databases and normally users don't need to change them, so we put them in database specific properties, e.g. # Configurations for MySQL
spring.datasource.hikari.connection-init-sql = SET NAMES utf8mb4
# You may change the following config to activate different database profiles like h2/postgres
spring.profiles.group.github = mysql |
b15465c
to
a3084b2
Compare
@nobodyiam spring.profiles.group.github is cool!!! Fixed |
apollo-adminservice/src/main/resources/application-mysql.properties
Outdated
Show resolved
Hide resolved
62e1bb1
to
5163e75
Compare
@nobodyiam Sorry, maybe I need a cup of coffee. The quality of the patch I was working on earlier was poor, and I was a bit distracted. But it's fixed now. |
fc04f5f
to
3ec58d8
Compare
…et user config database config
3ec58d8
to
9df198f
Compare
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.
LGTM
Brief changelog
Introduce h2 postgre profile properties to let user config database config
Follow this checklist to help us incorporate your contribution quickly and easily:
mvn clean test
to make sure this pull request doesn't break anything.CHANGES
log.