zjcnb commented on issue #18177:
URL:
https://github.com/apache/shardingsphere/issues/18177#issuecomment-1147104111
```
spring:
shardingsphere:
datasource:
names: ds0, ds1
ds0:
type: com.zaxxer.hikari.HikariDataSource
driverClassName: com.mysql.cj.jdbc.Driver
jdbcUrl:
jdbc:mysql://localhost:3306/demo_ds_0?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
username: root
password: 123456
poolName: datasource-one
ds1:
type: com.zaxxer.hikari.HikariDataSource
driverClassName: com.mysql.cj.jdbc.Driver
jdbcUrl:
jdbc:mysql://localhost:3306/demo_ds_1?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
username: root
password: 123456
poolName: datasource-two
rules:
sharding:
tables:
t_order:
actual-data-nodes: db$->{0..1}.t_order$->{0..3}
table-strategy:
standard:
sharding-algorithm-name: user-table-inline
sharding-column: order_id
database-strategy:
standard:
sharding-algorithm-name: user-db-inline
sharding-column: order_id
sharding-algorithms:
user-table-inline:
type: INLINE
props:
algorithm-expression: t_order$->{order_id % 4}
user-db-inline:
type: INLINE
props:
algorithm-expression: db$->{order_id % 2}
```
Please refer to this config.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]