新增sharding-jdbc-demo分库分表演示工程(sharding-sphere3.1.0)
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
sharding:
|
||||
jdbc:
|
||||
datasource:
|
||||
names: ds
|
||||
ds:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
url: jdbc:mysql://${zlt.datasource.ip}:3306/demo_ds?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull
|
||||
username: ${zlt.datasource.username}
|
||||
password: ${zlt.datasource.password}
|
||||
config:
|
||||
sharding:
|
||||
tables:
|
||||
user:
|
||||
actual-data-nodes: ds.user_$->{0..1}
|
||||
table-strategy:
|
||||
inline:
|
||||
sharding-column: id
|
||||
algorithm-expression: user_$->{id % 2}
|
||||
key-generator-column-name: id
|
||||
props:
|
||||
sql:
|
||||
show: true
|
||||
Reference in New Issue
Block a user