You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/10/25 06:42:14 UTC

[GitHub] [incubator-shardingsphere] terrymanu commented on a change in pull request #3371: Add hikari custom configuration support

terrymanu commented on a change in pull request #3371: Add hikari custom configuration support
URL: https://github.com/apache/incubator-shardingsphere/pull/3371#discussion_r338904579
 
 

 ##########
 File path: sharding-spring/sharding-jdbc-spring/sharding-jdbc-spring-boot-starter/src/main/java/org/apache/shardingsphere/shardingjdbc/spring/boot/SpringBootConfiguration.java
 ##########
 @@ -148,7 +156,13 @@ private DataSource getDataSource(final Environment environment, final String pre
         if (dataSourceProps.containsKey(jndiName)) {
             return getJndiDataSource(dataSourceProps.get(jndiName).toString());
         }
-        return DataSourceUtil.getDataSource(dataSourceProps.get("type").toString(), dataSourceProps);
+        String type = dataSourceProps.get("type").toString();
+        DataSource datasource = DataSourceUtil.getDataSource(type, dataSourceProps);
+        DataSourcePropertiesSetter dataSourcePropertiesSetter = DATA_SOURCE_PROPERTIES_SETTER_MAP.get(type);
+        if (null != dataSourcePropertiesSetter) {
+            dataSourcePropertiesSetter.propertiesSet(environment, prefix, dataSourceName, datasource);
+        }
+        return datasource;
 
 Review comment:
   please rename `datasource` to `result` if the variable is return value of method 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services