Add multi model config #195
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What did this pull request do?
通常情况下,多张业务逻辑表有多个分表的维度。例如,订单表可以按订单ID分表;同样,按用户ID分表,在根据用户ID查询订单时也能提速,就像我们常查看自己的订单那样。这个组件原来也是支持这种功能,只不过需要初始化不同的数据库实例才能实现。为了更好的支持这个功能:赋能单表,灵活支持多分表策略,我基于model实现多model的register。
User Case Description
support multiple config with multiple model register
model must implement ShardingInterface
example: base_test.go