linghengqian opened a new issue, #31282:
URL: https://github.com/apache/shardingsphere/issues/31282

   ## Feature Request
   
   **For English only**, other languages will not be accepted.
   
   Please pay attention on issues you submitted, because we maybe need more 
details. 
   If no response anymore and we cannot make decision by current information, 
we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Is your feature request related to a problem?
   
   - #24498
   - #22591
   
   ### Describe the feature you would like.
   
   - Add athe spring implementation for the JDBC Driver's `placeholder-type` 
parameter to read the YAML properties of `application.properties` or 
`application.yml` into ShardingSphere's configuration file. This seems like a 
natural thing to happen.
   - We can actually only do unit testing on Spring Boot OSS 2.7, which has 
stopped being maintained, because I don't want to use Java API on Spring Boot 
OSS 3 on JDK8 through reflection.
   - Consider the following jdbcURL.
   ```
   jdbc:shardingsphere:classpath:config.yaml?placeholder-type=spring
   ```
   - Assume that the following `application.yml` file exists in a typical 
Spring Boot project.
   ```yaml
   server:
     port: 8080
   
   key:
       something:
           fixture-config-driver-jdbc-url: 
jdbc:h2:mem:foo_ds_1;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MySQL
           fixture-config-driver-username: sa
   ```
   
   - Then for the intercepted fragment of the following YAML file `config.yaml`,
   ```yaml
   ds_1:
     dataSourceClassName: com.zaxxer.hikari.HikariDataSource
     driverClassName: $${fixture-config-driver-driver-class-name::org.h2.Driver}
     jdbcUrl: $${fixture-config-driver-jdbc-url::jdbc:h2:mem:foo_ds_do_not_use}
     username: $${fixture-config-driver-username::}
     password: $${fixture-config-driver-password::}
   ```
   - This YAML snippet will be parsed as,
   ```yaml
   ds_1:
     dataSourceClassName: com.zaxxer.hikari.HikariDataSource
     driverClassName: org.h2.Driver
     jdbcUrl: 
jdbc:h2:mem:foo_ds_1;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MySQL
     username: sa
     password:
   ```
   - Considering that Spring's dependencies are so huge, this is definitely an 
optional module.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to