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 2020/12/25 18:07:34 UTC

[GitHub] [shardingsphere] liyuhang712 commented on issue #8785: spring.shardingsphere.datasource.common.是要获取什么配置信息?

liyuhang712 commented on issue #8785:
URL: https://github.com/apache/shardingsphere/issues/8785#issuecomment-751277820


   这是我的配置文件,本意是想弄一个只分表不分库的单数据源策略.
   ```
   spring:
     shardingsphere:
       datasource:
         names: ds
         ds:
           type: com.zaxxer.hikari.HikariDataSource
           driver-class-name: com.mysql.cj.jdbc.Driver
           jdbc-url: jdbc:mysql://localhost:3306/asb?useUnicode=true&characterEncoding=utf-8
           username: root
           password: 123456!!
       rules:
         sharding:
           table:
             order:
               actual-data-nodes: ds.order_$->{0..1}
               table-strategy:
                 standard:
                   sharding-column: id
                   sharding-algorithm-name: t-order-inline
               key-generate-strategy:
                 column: id
                 key-generator-name: snowflake
           binding-tables: order
           sharding-algorithms:
             t-order-inline:
               type: INLINE
               props:
                 algorithm-expression: order_$->{id % 2}
           key-generators:
             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.

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