18435753200 commented on issue #11522:
URL: 
https://github.com/apache/shardingsphere/issues/11522#issuecomment-887167956


   spring:
     shardingsphere:
       datasource:
         names: ds0 # 指定数据源名字,多数据源以逗号分隔
         ds0:
           type: com.zaxxer.hikari.HikariDataSource
           driver-class-name: com.mysql.cj.jdbc.Driver
           jdbc-url: 
jdbc:mysql://localhost:3306/order_0?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8
           username: root
           password: zxcvbnm&123
       rules:
         sharding:
           tables:
             # 配置 t_order 表规则
             t_order:
               actual-data-nodes: ds0.t_order_$->{0..2}
               table-strategy:
                 standard:
                   sharding-column: id
                   sharding-algorithm-name: table_inline
           # 配置分片算法
           sharding-algorithms:
             table_inline:
               type: INLINE
               props:
                 algorithm-expression: t_order_$->{id % 3}
       # 绑定表规则,即逻辑表名。(例如t_user代表了t_user_0, t_user_1, t_user_2 ...)
       binding-tables: t_order
       props:
         sql.show: true # 是否开启SQL显示
   


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