Qianyi951015 commented on issue #24074:
URL: 
https://github.com/apache/shardingsphere/issues/24074#issuecomment-1425174985

   > Hi @Qianyi951015 , could you supply the text of sharding yaml file?
   
   sure,
   ```
   databaseName: sharding_db
   
   dataSources:
     ds_0:
       url: jdbc:mysql://127.0.0.1:3306/db0?serverTimezone=UTC&useSSL=false
       username: root
       password: 123456
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_1:
       url: jdbc:mysql://127.0.0.1:3306/db1?serverTimezone=UTC&useSSL=false
       username: root
       password: 123456
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
   
   rules:
   - !SHARDING
     tables:
       t_order:
         actualDataNodes: ds_${0..1}.t_order_${0..1}
         tableStrategy:
           standard:
             shardingColumn: order_id
             shardingAlgorithmName: t_order_inline
         databaseStrategy:
           none:
         keyGenerateStrategy:
           column: order_id
           keyGeneratorName: snowflake
         auditStrategy:
           auditorNames:
             - sharding_key_required_auditor
           allowHintDisable: true
     defaultDatabaseStrategy:
       standard:
         shardingColumn: user_id
         shardingAlgorithmName: database_inline
     defaultTableStrategy:
       none:
     defaultAuditStrategy:
       auditorNames:
         - sharding_key_required_auditor
       allowHintDisable: true
   
     shardingAlgorithms:
       database_inline:
         type: INLINE
         props:
           algorithm-expression: ds_${user_id % 2}
       t_order_inline:
         type: INLINE
         props:
           algorithm-expression: t_order_${order_id % 2}
       t_order_item_inline:
         type: INLINE
         props:
           algorithm-expression: t_order_item_${order_id % 2}
   
     keyGenerators:
       snowflake:
         type: SNOWFLAKE
   
     auditors:
       sharding_key_required_auditor:
         type: DML_SHARDING_CONDITIONS
   ```


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