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 2022/01/29 16:21:44 UTC

[GitHub] [shardingsphere] LostMyth commented on issue #15162: Why did my logical sql same as actual sql?

LostMyth commented on issue #15162:
URL: https://github.com/apache/shardingsphere/issues/15162#issuecomment-1024941216


   > 
   
   ### This is complete configuration.
   
   ```
   shardingsphere:
       datasource:
         names: master0
         hikari:
           minimum-idle: 20
           connection-test-query: SELECT 1 FROM DUAL
           maximum-pool-size: 200
           auto-commit: true
           idle-timeout: 30000
           pool-name: HikariPool-1
           max-lifetime: 28000
           connection-timeout: 30000
         master0:
           type: com.zaxxer.hikari.HikariDataSource
           driver-class-name: com.mysql.cj.jdbc.Driver
           jdbc-url: jdbc:mysql://localhost:3306/cloud_hash?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&tinyInt1isBit=false&rewriteBatchedStatements=true
           username: root
           password: 11111
       sharding:
         tables:
           block_order: #block_order表
             actual-data-nodes: master0.block_order_$->{0..9}    #数据节点,均匀分布,这种是单库多表
             table-strategy: #分表策略
               standard:
                 sharding-column: tran_hash
                 precise-algorithm-class-name: com.xxx.MyPreciseShardingAlgorithm
           reward:
             actual-data-nodes: master0.reward_$->{0..9}
             table-strategy: #分表策略
               standard:
                 sharding-column: tran_hash
                 precise-algorithm-class-name: com.xxxMyPreciseShardingAlgorithm
       props:
         sql: #打印sql
           show: true
   ```
   
   ### pom.xml
   ```
          <parent>
           <groupId>org.springframework.boot</groupId>
           <artifactId>spring-boot-starter-parent</artifactId>
           <version>2.2.2.RELEASE</version>
           <relativePath/>
       </parent>
         ...
          <dependency>
               <groupId>org.apache.shardingsphere</groupId>
               <artifactId>sharding-jdbc-spring-boot-starter</artifactId>
               <version>4.1.1</version>
           </dependency>
   
           <dependency>
               <groupId>org.apache.shardingsphere</groupId>
               <artifactId>sharding-jdbc-spring-namespace</artifactId>
               <version>4.1.1</version>
           </dependency>
   ```


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