dataSources:
  ds1:
    dataSourceClassName: org.apache.commons.dbcp2.BasicDataSource
    driverClassName: org.postgresql.Driver
    url: jdbc:postgresql://localhost/Test?currentSchema=ds1
    username: postgres
    password: hemmeligt
  ds2:
    dataSourceClassName: org.apache.commons.dbcp2.BasicDataSource
    driverClassName: org.postgresql.Driver
    url: jdbc:postgresql://localhost/Test?currentSchema=ds2
    username: postgres
    password: hemmeligt

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
