tuichenchuxin opened a new issue #11615:
URL: https://github.com/apache/shardingsphere/issues/11615
## Feature Request
### Is your feature request related to a problem?
No, the purpose is to simplify the configuration.
### Describe the feature you would like.
#### Background
`StandardShardingStrategy` has property `shardingColumn`.
This sharding column must be set in configuration file. But when i have many
tables need same sharding column, I have to configure it many times.
So , may be add `defaultShardingColumn` is a good choice.
#### Purpuse
When the `shardingColumn` in the configuration is not configured, then the
`defaultShardingColumn` will be used instead.
#### Realization ideas
- Load configuration items into `ShardingRuleConfiguration`
- when creating `StandardShardingStrategy` , if `shardingColumn` in
`StandardShardingStrategyConfiguration` is null, then use
`defaultShardingColumn` to instead.
##### Implementation
1. Determine the position level of defaultShardingColumn in the configuration
```
defaultDatabaseStrategy:
standard:
shardingColumn: user_id
shardingAlgorithmName: database_inline
defaultTableStrategy:
standard:
shardingColumn: order_id
shardingAlgorithmName: hs
defaultShardingColumn: order_id
```
2. Load into YAML configuration
3. Load into `ShardingRuleConfiguration`
4. Load `defaultShardingColumn` into `ShardingRule`
5. when creating `StandardShardingStrategy` , if `shardingColumn` in
`StandardShardingStrategyConfiguration` is null, then use
`defaultShardingColumn` to instead.
--
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]