zjbxxx commented on issue #12424:
URL: 
https://github.com/apache/shardingsphere/issues/12424#issuecomment-918973620


   > @zjbxxx你能告诉我配置吗?
   
   schemaName: heattingwork
   dataSources:
     ds_0:
       url: 
jdbc:mysql://127.0.0.1:3306/heattingwork?serverTimezone=UTC&useSSL=false
       username: root
       password: 1234
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       
       
   rules:
   - !SHARDING
     tables:
       dtu_log:
         actualDataNodes: ds_0.dtu_log_$->{2021..2022}${(1..12).collect{t 
->t.toString().padLeft(2,'0')}}
         tableStrategy:
           standard:
             shardingColumn: create_date
             shardingAlgorithmName: t_order_inline
         keyGenerateStrategy:
           column: id
           keyGeneratorName: snowflake
   
     bindingTables:
       - dtu_log
     defaultDatabaseStrategy:
       standard:
         shardingColumn: user_id
         shardingAlgorithmName: database_inline
     defaultTableStrategy:
       none:
   
     shardingAlgorithms:
       database_inline:
         type: INLINE
         props:
           algorithm-expression: ds_${user_id % 2}
       t_order_inline:
         type: INLINE
         props:
           algorithm-expression: dtu_log_$->{create_date.take(4) + 
create_date[5,6]}
           allow-range-query-with-inline-sharding: true
   
     keyGenerators:
       snowflake:
         type: SNOWFLAKE
         props:
           worker-id: 123


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