You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/08/05 04:08:30 UTC

[GitHub] [shardingsphere] zjcnb edited a comment on issue #11621: ShardingSphere-jdbc configuration add schema name

zjcnb edited a comment on issue #11621:
URL: https://github.com/apache/shardingsphere/issues/11621#issuecomment-893147114


   example for yml:
   
   `
   schemaName: logic_db
   
   rules:
   - !SHARDING
     tables:
       t_order:
         actualDataNodes: jdbc_${0..1}.t_order_${0..1}
       t_order_item:
         actualDataNodes: jdbc_${0..1}.t_order_item_${0..1}
         keyGenerateStrategy:
           column: item_id
           keyGeneratorName: increment
       t_config:
         actualDataNodes: jdbc_${0..1}.t_config
       t_user:
         actualDataNodes: jdbc_0.t_user_${0..1}
         tableStrategy:
           standard:
             shardingColumn: id
             shardingAlgorithmName: table_inline
         keyGenerateStrategy:
           column: id
           keyGeneratorName: reset_increment
     autoTables:
       t_order_auto:
         actualDataSources: jdbc_0, jdbc_1
         shardingStrategy:
           standard:
             shardingColumn: order_id
             shardingAlgorithmName: mod
       t_order_item_auto:
         shardingStrategy:
           standard:
             shardingColumn: order_id
             shardingAlgorithmName: mod
     bindingTables:
       - t_order,t_order_item
     broadcastTables:
       - t_config
       - t_sys
     defaultTableStrategy:
       standard:
         shardingColumn: order_id
         shardingAlgorithmName: standard_test
     defaultDatabaseStrategy:
       standard:
         shardingColumn: user_id
         shardingAlgorithmName: standard_test
     
     shardingAlgorithms:
       standard_test:
           type: STANDARD_TEST
       table_inline:
         type: INLINE
         props:
           algorithm-expression: t_user_${id % 2}
       mod:
         type: MOD
         props:
           sharding-count: 2
     
     keyGenerators:
       increment:
         type: INCREMENT
       reset_increment:
         type: RESET_INCREMENT
   `


-- 
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-unsubscribe@shardingsphere.apache.org

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