sharding:
  jdbc:
    datasource:
      names: ds-alibaba,ds-baidu
      ds-alibaba:
        type: com.alibaba.druid.pool.DruidDataSource
        driver-class-name: com.mysql.jdbc.Driver
        url: jdbc:mysql://${zlt.datasource.ip}:3306/demo_ds_alibaba?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
        username: ${zlt.datasource.username}
        password: ${zlt.datasource.password}
      ds-baidu:
        type: com.alibaba.druid.pool.DruidDataSource
        driver-class-name: com.mysql.jdbc.Driver
        url: jdbc:mysql://${zlt.datasource.ip}:3306/demo_ds_baidu?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
        username: ${zlt.datasource.username}
        password: ${zlt.datasource.password}
    config:
      sharding:
        default-database-strategy:
          inline:
            sharding-column: company_id
            algorithm-expression: ds-$->{company_id}
        tables:
          user:
            actual-data-nodes: ds-$->{['alibaba','baidu']}.user
            key-generator-column-name: id
      props:
        sql:
          show: true