RaigorJiang commented on issue #15985:
URL:
https://github.com/apache/shardingsphere/issues/15985#issuecomment-1066050772
Two problems:
1. When `new ShardingAutoTableRuleConfiguration`, the second parameter
should be `ds`, only specify dataSources:
````java
`ShardingAutoTableRuleConfiguration(final String logicTable, final String
actualDataSources)`
````
2. Regarding inline expressions, no matter what your actual databases are
called, the keys in dataSourceMap can be regular, such as
````java
Map<String,DataSource> dataSourceMap = new HashMap<>();
dataSourceMap.put("ds_0",dataSource); // shardingone
dataSourceMap.put("ds_1",dataSource1); // shardingtwo
ShardingRuleConfiguration shardingRuleConfiguration = new
ShardingRuleConfiguration();
ShardingTableRuleConfiguration nihao = new
ShardingTableRuleConfiguration("user","ds_${0..1}");
shardingRuleConfiguration.getTables().add(nihao);
````
--
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]