mattmok commented on issue #17719:
URL: 
https://github.com/apache/shardingsphere/issues/17719#issuecomment-1130899715

   > I think split database is base of split table,for example: two databases : 
ds_0 、ds_1
   > 
   > two tables : tb0、tb1
   > 
   > if we want to split database , we aim at tb0 split database. in this case 
, tb1 can not config at file,so this table is not split.
   > 
   > we can config like this :
   > 
   > ```yaml
   > dataSources:
   >   ds_0:
   >     dataSourceClassName: com.zaxxer.hikari.HikariDataSource
   >     driverClassName: com.mysql.jdbc.Driver
   >     jdbcUrl: 
jdbc:mysql://localhost:3306/demo_ds_0?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
   >     username: root
   >     password: 123456
   >   ds_1:
   >     dataSourceClassName: com.zaxxer.hikari.HikariDataSource
   >     driverClassName: com.mysql.jdbc.Driver
   >     jdbcUrl: 
jdbc:mysql://localhost:3306/demo_ds_1?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
   >     username: root
   >     password: 123456
   > 
   > rules:
   > - !SHARDING
   >   tables:
   >     tb0:
   >       actualDataNodes: ds_${0..1}.tb0
   >       keyGenerateStrategy:
   >         column: account_id
   >         keyGeneratorName: snowflake
   >   defaultDatabaseStrategy:
   >     standard:
   >       shardingColumn: user_id
   >       shardingAlgorithmName: database-inline
   >   defaultTableStrategy:
   >     none:
   >   
   >   shardingAlgorithms:
   >     database-inline:
   >       type: INLINE
   >       props:
   >         algorithm-expression: ds_${user_id % 2}
   >     
   >   keyGenerators:
   >     snowflake:
   >       type: SNOWFLAKE
   > ```
   
   That means, if there are 100 tables that are only sharding databases and not 
sharding tables, do I have to configure 100 table rules?


-- 
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: notifications-unsubscr...@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to