This is an automated email from the ASF dual-hosted git repository.

panjuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 0e31ffe  update data source configuration of yaml (#14188)
0e31ffe is described below

commit 0e31ffe7675c45f93c7548efd61b56e8a28af368
Author: Haoran Meng <[email protected]>
AuthorDate: Tue Dec 21 14:32:03 2021 +0800

    update data source configuration of yaml (#14188)
    
    Co-authored-by: shardingsphere <[email protected]>
---
 .../yaml-config/data-source.cn.md                  | 41 ++++------------------
 .../yaml-config/data-source.en.md                  | 41 ++++------------------
 2 files changed, 14 insertions(+), 68 deletions(-)

diff --git 
a/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/data-source.cn.md
 
b/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/data-source.cn.md
index 2da31f7..f967d4b 100644
--- 
a/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/data-source.cn.md
+++ 
b/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/data-source.cn.md
@@ -8,43 +8,14 @@ chapter = true
 
 示例的数据库驱动为 MySQL,连接池为 HikariCP,可以更换为其他数据库驱动和连接池。
 
-## 单数据源配置
-
-用于数据加密等规则。
-
-### 配置项说明
-
-```yaml
-dataSource: # <!!数据库连接池实现类> `!!`表示实例化该类
-  driverClassName: # 数据库驱动类名,以数据库连接池自身配置为准
-  url: # 数据库 URL 连接,以数据库连接池自身配置为准
-  username: # 数据库用户名,以数据库连接池自身配置为准
-  password: # 数据库密码,以数据库连接池自身配置为准
-  # ... 数据库连接池的其它属性
-```
-
-### 配置示例
-
-```yaml
-dataSource: !!com.zaxxer.hikari.HikariDataSource
-  driverClassName: com.mysql.jdbc.Driver
-  jdbcUrl: jdbc:mysql://localhost:3306/ds
-  username: root
-  password:
-```
-
-## 多数据源配置
-
-用于分片、读写分离等规则。
-如果加密和分片等功能混合使用,则应使用多数据源配置。
-
 ### 配置项说明
 
 ```yaml
 dataSources: # 数据源配置,可配置多个 <data-source-name>
-  <data-source-name>: # <!!数据库连接池实现类>,`!!` 表示实例化该类
+  <data-source-name>: # 数据源名称
+    dataSourceClassName: # 数据源完整类名
     driverClassName: # 数据库驱动类名,以数据库连接池自身配置为准
-    url: # 数据库 URL 连接,以数据库连接池自身配置为准
+    jdbcUrl: # 数据库 URL 连接,以数据库连接池自身配置为准
     username: # 数据库用户名,以数据库连接池自身配置为准
     password: # 数据库密码,以数据库连接池自身配置为准
     # ... 数据库连接池的其它属性
@@ -54,12 +25,14 @@ dataSources: # 数据源配置,可配置多个 <data-source-name>
 
 ```yaml
 dataSources:
-  ds_1: !!com.zaxxer.hikari.HikariDataSource
+  ds_1:
+    dataSourceClassName: com.zaxxer.hikari.HikariDataSource
     driverClassName: com.mysql.jdbc.Driver
     jdbcUrl: jdbc:mysql://localhost:3306/ds_1
     username: root
     password:
-  ds_2: !!com.zaxxer.hikari.HikariDataSource
+  ds_2:
+    dataSourceClassName: com.zaxxer.hikari.HikariDataSource
     driverClassName: com.mysql.jdbc.Driver
     jdbcUrl: jdbc:mysql://localhost:3306/ds_2
     username: root
diff --git 
a/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/data-source.en.md
 
b/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/data-source.en.md
index b5b710d..7999a0d 100644
--- 
a/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/data-source.en.md
+++ 
b/docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/data-source.en.md
@@ -9,43 +9,14 @@ ShardingSphere-JDBC Supports all JDBC drivers and database 
connection pools.
 
 In this example, the database driver is MySQL, and connection pool is 
HikariCP, which can be replaced with other database drivers and connection 
pools.
 
-## Single Data Source Configuration
-
-Used for data encryption rules.
-
-### Configuration Item Explanation
-
-```yaml
-dataSource: # <!!Data source pool implementation class> `!!` means class 
instantiation
-  driverClassName: # Class name of database driver, ref property of connection 
pool
-  url: # Database URL, ref property of connection pool
-  username: # Database username, ref property of connection pool
-  password: # Database password, ref property of connection pool
-  # ... Other properties for data source pool
-```
-
-### Example
-
-```yaml
-dataSource: !!com.zaxxer.hikari.HikariDataSource
-  driverClassName: com.mysql.jdbc.Driver
-  jdbcUrl: jdbc:mysql://localhost:3306/ds
-  username: root
-  password:
-```
-
-## Multiple Data Source Configuration
-
-Used for fragmentation, readwrite-splitting and other rules.
-If features such as encryption and sharding are used in combination, a multi 
data source configuration should be used.
-
 ### Configuration Item Explanation
 
 ```yaml
 dataSources: # Data sources configuration, multiple <data-source-name> 
available
-  <data-source-name>: # <!!Data source pool implementation class> `!!` means 
class instantiation
+  <data-source-name>: # Data source name
+    dataSourceClassName: # Data source class name
     driverClassName: # Class name of database driver, ref property of 
connection pool
-    url: # Database URL, ref property of connection pool
+    jdbcUrl: # Database URL, ref property of connection pool
     username: # Database username, ref property of connection pool
     password: # Database password, ref property of connection pool
     # ... Other properties for data source pool
@@ -55,12 +26,14 @@ dataSources: # Data sources configuration, multiple 
<data-source-name> available
 
 ```yaml
 dataSources:
-  ds_1: !!com.zaxxer.hikari.HikariDataSource
+  ds_1:
+    dataSourceClassName: com.zaxxer.hikari.HikariDataSource
     driverClassName: com.mysql.jdbc.Driver
     jdbcUrl: jdbc:mysql://localhost:3306/ds_1
     username: root
     password:
-  ds_2: !!com.zaxxer.hikari.HikariDataSource
+  ds_2:
+    dataSourceClassName: com.zaxxer.hikari.HikariDataSource
     driverClassName: com.mysql.jdbc.Driver
     jdbcUrl: jdbc:mysql://localhost:3306/ds_2
     username: root

Reply via email to