dataSources:
  ds1:
    dataSourceClassName: org.apache.commons.dbcp2.BasicDataSource
    driverClassName: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost/ds1
    username: root
    password: 
  ds2:
    dataSourceClassName: org.apache.commons.dbcp2.BasicDataSource
    driverClassName: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost/ds2
    username: root
    password: 

rules:
- !SHARDING
  tables:
    t: 
      actualDataNodes: ds${1..2}.t
      databaseStrategy:
        standard:
          shardingColumn: id
          shardingAlgorithmName: t_id_inline
  shardingAlgorithms:
    t_id_inline:
      type: INLINE
      props:
        algorithm-expression: ds${1 + id % 2}
        allow-range-query-with-inline-sharding: true

props:
  sql-show: false
