Single Table
Background
Single rule is used to specify which single tables need to be managed by ShardingSphere, or to set the default single table data source.
Parameters
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 | - |
Procedure
- Initialize SingleRuleConfiguration;
- Add a single table to be loaded and configure the default data source.
Sample
SingleRuleConfiguration ruleConfig = new SingleRuleConfiguration();
ShardingSphereDataSourceFactory.createDataSource(createDataSourceMap(), Arrays.asList(ruleConfig), new Properties());
Related References
当前内容版权归 ShardingSphere 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 ShardingSphere .