jitawangzi opened a new issue, #18404:
URL: https://github.com/apache/shardingsphere/issues/18404

   My requirement is that all tables are sharded according to played_id mod, 
route to all data sources。I configured it like this, but it seems that all the 
data sources need to be configured for each table, and new tables may be added 
in the future. Is there some simple configuration method?
   
   `schemaName: game_sharding_db
   
   dataSources:
     ds_0:
       url: 
jdbc:mysql://127.0.0.1:3306/game_ds_0?serverTimezone=UTC&useSSL=false
       username: root
       password: root
     ds_1:
       url: 
jdbc:mysql://127.0.0.1:3306/game_ds_1?serverTimezone=UTC&useSSL=false
       username: root
       password: root
     ds_2:
       url: 
jdbc:mysql://127.0.0.1:3306/game_ds_2?serverTimezone=UTC&useSSL=false
       username: root
       password: root
   
   rules:
   - !SHARDING
     defaultDatabaseStrategy:
       standard:
         shardingColumn: player_id
         shardingAlgorithmName: default_database_sharding
     defaultTableStrategy:
       standard:
         shardingColumn: player_id
         shardingAlgorithmName: default_table_sharding
     autoTables:
       t_item:
         actualDataSources: ds_0,ds_1,ds_2
         shardingStrategy:
           standard:
             shardingColumn: player_id
             shardingAlgorithmName: default_table_sharding
       t_player:
         actualDataSources: ds_0,ds_1,ds_2
         shardingStrategy:
           standard:
             shardingColumn: player_id
             shardingAlgorithmName: default_table_sharding
   
     shardingAlgorithms:
       default_database_sharding:
         type: MOD
         props:
           sharding-count: 3
       default_table_sharding:
         type: MOD
         props:
           sharding-count: 3
    `
   
   


-- 
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]

Reply via email to