Single rule is used to specify which single tables need to be managed by ShardingSphere, or to set the default single table data source.
Class:org.apache.shardingsphere.single.api.config.SingleRuleConfiguration
Attributes:
name | DataType | Description | Default Value |
---|---|---|---|
tables (+) | Collection<String> | single tables | - |
defaultDataSource (?) | String | single table default data source | - |
SingleRuleConfiguration ruleConfig = new SingleRuleConfiguration();
ShardingSphereDataSourceFactory.createDataSource(createDataSourceMap(), Arrays.asList(ruleConfig), new Properties());