You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/03/06 07:07:28 UTC

[GitHub] [incubator-shardingsphere] xiaoxing598 edited a comment on issue #1976: How to configure a custom sharding strategy?

xiaoxing598 edited a comment on issue #1976: How to configure a custom sharding strategy?
URL: https://github.com/apache/incubator-shardingsphere/issues/1976#issuecomment-469993989
 
 
   What if you specify a custom sharding algorithm in the configuration file?
   
   ```properties
   sharding.jdbc.config.sharding.default-database-strategy.inline.sharding-column=user_id
   sharding.jdbc.config.sharding.default-database-strategy.inline.algorithm-expression=master$->{user_id % 2}
   ```
   
   ```properties
   ...default-database-strategy.inline.algorithm-expression=master$->{user_id PreciseConsistentHashShardingDatabaseAlgorithm}
   ```
   
   This should be the question I eventually want to ask. I don't want to move all the configuration in the file into the code.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services