This is an automated email from the ASF dual-hosted git repository.
jianglongtao 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 f7320e7db02 Add `mask rule` usage DistSQL document (#23293)
f7320e7db02 is described below
commit f7320e7db028ef0ad13efaefd3dcf18172d22ad7
Author: Zichao <[email protected]>
AuthorDate: Tue Jan 3 22:45:54 2023 +1300
Add `mask rule` usage DistSQL document (#23293)
* Add `mask rule` usage DistSQL document
* Add `mask rule` usage DistSQL document
* Add `mask rule` usage DistSQL document
---
.../distsql/usage/_index.cn.md | 2 +-
.../distsql/usage/_index.en.md | 2 +-
.../distsql/usage/db-discovery.cn.md | 2 +-
.../distsql/usage/db-discovery.en.md | 2 +-
.../distsql/usage/encrypt-rule.cn.md | 2 +-
.../distsql/usage/encrypt-rule.en.md | 2 +-
.../distsql/usage/mask-rule.cn.md | 67 ++++++++++++++++++++++
.../distsql/usage/mask-rule.en.md | 67 ++++++++++++++++++++++
.../distsql/usage/readwirte-splitting-rule.cn.md | 2 +-
.../distsql/usage/readwirte-splitting-rule.en.md | 2 +-
.../distsql/usage/shadow-rule.cn.md | 2 +-
.../distsql/usage/shadow-rule.en.md | 2 +-
.../distsql/usage/sharding-rule.cn.md | 2 +-
.../distsql/usage/sharding-rule.en.md | 2 +-
14 files changed, 146 insertions(+), 12 deletions(-)
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/_index.cn.md
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/_index.cn.md
index ac0bebf95c4..e52a4e8927c 100644
---
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/_index.cn.md
+++
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/_index.cn.md
@@ -1,6 +1,6 @@
+++
title = "使用"
-weight = 2
+weight = 1
chapter = true
+++
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/_index.en.md
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/_index.en.md
index c53dba17ba2..17da2be6125 100644
---
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/_index.en.md
+++
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/_index.en.md
@@ -1,6 +1,6 @@
+++
title = "Usage"
-weight = 2
+weight = 1
chapter = true
+++
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/db-discovery.cn.md
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/db-discovery.cn.md
index b6932585ad0..c77b52bae68 100644
---
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/db-discovery.cn.md
+++
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/db-discovery.cn.md
@@ -1,6 +1,6 @@
+++
title = "数据库发现"
-weight = 5
+weight = 4
+++
## 存储单元操作
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/db-discovery.en.md
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/db-discovery.en.md
index 08f7b571ce3..4a8af238731 100644
---
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/db-discovery.en.md
+++
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/db-discovery.en.md
@@ -1,6 +1,6 @@
+++
title = "DB Discovery"
-weight = 5
+weight = 4
+++
## Storage unit Operation
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/encrypt-rule.cn.md
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/encrypt-rule.cn.md
index e21afa62a48..9d7ec155c70 100644
---
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/encrypt-rule.cn.md
+++
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/encrypt-rule.cn.md
@@ -1,6 +1,6 @@
+++
title = "数据加密"
-weight = 3
+weight = 5
+++
## 存储单元操作
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/encrypt-rule.en.md
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/encrypt-rule.en.md
index 9a4da767973..c4d3aaf6ccd 100644
---
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/encrypt-rule.en.md
+++
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/encrypt-rule.en.md
@@ -1,6 +1,6 @@
+++
title = "Encrypt"
-weight = 3
+weight = 5
+++
## Storage unit Operation
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/mask-rule.cn.md
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/mask-rule.cn.md
new file mode 100644
index 00000000000..9df49c12c36
--- /dev/null
+++
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/mask-rule.cn.md
@@ -0,0 +1,67 @@
++++
+title = "数据脱敏"
+weight = 7
++++
+
+## 存储单元操作
+
+```sql
+REGISTER STORAGE UNIT ds_0 (
+ HOST="127.0.0.1",
+ PORT=3306,
+ DB="ds_0",
+ USER="root",
+ PASSWORD="root"
+);
+```
+
+## 规则操作
+
+- 创建数据脱敏规则
+
+```sql
+CREATE MASK RULE t_mask (
+ COLUMNS(
+ (NAME=phone_number,TYPE(NAME='MASK_FROM_X_TO_Y',
PROPERTIES("from-x"=1, "to-y"=2, "replace-char"="*"))),
+ (NAME=address,TYPE(NAME='MD5'))
+));
+```
+
+- 创建数据脱敏表
+
+```sql
+CREATE TABLE `t_mask` (
+ `id` int(11) NOT NULL,
+ `user_id` varchar(45) DEFAULT NULL,
+ `phone_number` varchar(45) DEFAULT NULL,
+ `address` varchar(45) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+```
+
+- 修改数据脱敏规则
+
+```sql
+ALTER MASK RULE t_mask (
+ COLUMNS(
+ (NAME=user_id,TYPE(NAME='MD5'))
+));
+```
+
+- 删除数据脱敏规则
+
+```sql
+DROP MASK RULE t_mask;
+```
+
+- 移除数据源
+
+```sql
+UNREGISTER STORAGE UNIT ds_0;
+```
+
+- 删除分布式数据库
+
+```sql
+DROP DATABASE mask_db;
+```
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/mask-rule.en.md
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/mask-rule.en.md
new file mode 100644
index 00000000000..e058c3f4a0f
--- /dev/null
+++
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/mask-rule.en.md
@@ -0,0 +1,67 @@
++++
+title = "MASK"
+weight = 7
++++
+
+## Storage unit Operation
+
+```sql
+REGISTER STORAGE UNIT ds_0 (
+ HOST="127.0.0.1",
+ PORT=3306,
+ DB="ds_0",
+ USER="root",
+ PASSWORD="root"
+);
+```
+
+## Rule Operation
+
+- Create mask rule
+
+```sql
+CREATE MASK RULE t_mask (
+ COLUMNS(
+ (NAME=phone_number,TYPE(NAME='MASK_FROM_X_TO_Y',
PROPERTIES("from-x"=1, "to-y"=2, "replace-char"="*"))),
+ (NAME=address,TYPE(NAME='MD5'))
+));
+```
+
+- Create mask table
+
+```sql
+CREATE TABLE `t_mask` (
+ `id` int(11) NOT NULL,
+ `user_id` varchar(45) DEFAULT NULL,
+ `phone_number` varchar(45) DEFAULT NULL,
+ `address` varchar(45) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+```
+
+- Alter mask rule
+
+```sql
+ALTER MASK RULE t_mask (
+ COLUMNS(
+ (NAME=user_id,TYPE(NAME='MD5'))
+));
+```
+
+- Drop mask rule
+
+```sql
+DROP MASK RULE t_mask;
+```
+
+- Unregister storage unit
+
+```sql
+UNREGISTER STORAGE UNIT ds_0;
+```
+
+- Drop distributed database
+
+```sql
+DROP DATABASE mask_db;
+```
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/readwirte-splitting-rule.cn.md
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/readwirte-splitting-rule.cn.md
index edc672b011c..98ae5e4ac72 100644
---
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/readwirte-splitting-rule.cn.md
+++
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/readwirte-splitting-rule.cn.md
@@ -1,6 +1,6 @@
+++
title = "读写分离"
-weight = 2
+weight = 3
+++
## 存储单元操作
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/readwirte-splitting-rule.en.md
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/readwirte-splitting-rule.en.md
index 0d46c1fc4f6..9975c62a183 100644
---
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/readwirte-splitting-rule.en.md
+++
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/readwirte-splitting-rule.en.md
@@ -1,6 +1,6 @@
+++
title = "Readwrite_splitting"
-weight = 2
+weight = 3
+++
## Storage unit Operation
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/shadow-rule.cn.md
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/shadow-rule.cn.md
index 0d018a258b8..04d281f5643 100644
---
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/shadow-rule.cn.md
+++
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/shadow-rule.cn.md
@@ -1,6 +1,6 @@
+++
title = "影子库压测"
-weight = 5
+weight = 6
+++
## 存储单元操作
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/shadow-rule.en.md
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/shadow-rule.en.md
index 0624ec690cb..708babb5d1c 100644
---
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/shadow-rule.en.md
+++
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/shadow-rule.en.md
@@ -1,6 +1,6 @@
+++
title = "Shadow"
-weight = 5
+weight = 6
+++
## Storage unit Operation
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/sharding-rule.cn.md
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/sharding-rule.cn.md
index 21484becf12..446bbe62a4d 100644
---
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/sharding-rule.cn.md
+++
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/sharding-rule.cn.md
@@ -1,6 +1,6 @@
+++
title = "数据分片"
-weight = 1
+weight = 2
+++
## 存储单元操作
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/sharding-rule.en.md
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/sharding-rule.en.md
index 192f0d2c961..081eb636179 100644
---
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/sharding-rule.en.md
+++
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/sharding-rule.en.md
@@ -1,6 +1,6 @@
+++
title = "Sharding"
-weight = 1
+weight = 2
+++
## Storage unit Operation