Skip to content

Commit

Permalink
feat: update-readme, format configuration yaml (#592)
Browse files Browse the repository at this point in the history
Co-authored-by: guop <[email protected]>
  • Loading branch information
alvinkwok1 and guop authored Nov 16, 2023
1 parent 5ff0cc4 commit 93fe2cb
Showing 1 changed file with 33 additions and 27 deletions.
60 changes: 33 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,37 +127,43 @@ spring:
#以上会配置一个默认库master,一个组slave下有两个子库slave_1,slave_2
```

**多主多从:**
```yaml
# 多主多从 纯粹多库(记得设置primary) 混合配置
spring:
spring:
spring:
datasource:
datasource:
datasource:
dynamic:
dynamic:
dynamic:
datasource:
datasource:
datasource:
master_1:
mysql:
master:
master_2:
oracle:
slave_1:
slave_1:
sqlserver:
slave_2:
slave_2:
postgresql:
oracle_1:
slave_3:
h2:
oracle_2:
datasource:
dynamic:
master_1:
master_2:
slave_1:
slave_2:
slave_3:
```
**纯粹多库:**
```yaml
spring:
datasource:
dynamic:
mysql:
oracle:
sqlserver:
postgresql:
h2:
```
**混合配置:**
```yaml
spring:
datasource:
dynamic:
master:
slave_1:
slave_2:
oracle_1:
oracle_2:
```
3. 使用 **@DS** 切换数据源。
**@DS** 可以注解在方法上或类上,**同时存在就近原则 方法上注解 优先于 类上注解**。
Expand Down

0 comments on commit 93fe2cb

Please sign in to comment.