You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by ji...@apache.org on 2022/10/25 11:28:56 UTC

[shardingsphere] branch master updated: Add `COUNT SINGLE_TABLE RULE` docs. (#21737)

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 e110140dfd0 Add `COUNT SINGLE_TABLE RULE` docs. (#21737)
e110140dfd0 is described below

commit e110140dfd06f8778666636d509fafca03c2dc08
Author: Jieker <ji...@163.com>
AuthorDate: Tue Oct 25 19:28:50 2022 +0800

    Add `COUNT SINGLE_TABLE RULE` docs. (#21737)
---
 .../reference/distsql/syntax/reserved-word.cn.md   |  2 +-
 .../reference/distsql/syntax/reserved-word.en.md   |  2 +-
 .../single-table/count-single-table-rule.cn.md     | 57 ++++++++++++++++++++++
 .../single-table/count-single-table-rule.en.md     | 56 +++++++++++++++++++++
 .../show-deafult-single-table-storage-unit.cn.md   |  2 +-
 .../show-deafult-single-table-storage-unit.en.md   |  2 +-
 .../single-table/show-single-table.en.md           |  2 +-
 7 files changed, 118 insertions(+), 5 deletions(-)

diff --git a/docs/document/content/reference/distsql/syntax/reserved-word.cn.md b/docs/document/content/reference/distsql/syntax/reserved-word.cn.md
index d87fc5c9233..34d603ce50e 100644
--- a/docs/document/content/reference/distsql/syntax/reserved-word.cn.md
+++ b/docs/document/content/reference/distsql/syntax/reserved-word.cn.md
@@ -60,7 +60,7 @@ weight = 3
 
 #### 单表
 
-`SINGLE`、`STORAGE`、`UNIT`
+`SINGLE`、`STORAGE`、`UNIT`、`COUNT`、`SINGLE_TABLE`
 
 ## 补充说明
 
diff --git a/docs/document/content/reference/distsql/syntax/reserved-word.en.md b/docs/document/content/reference/distsql/syntax/reserved-word.en.md
index 9604818f738..e7802a41a64 100644
--- a/docs/document/content/reference/distsql/syntax/reserved-word.en.md
+++ b/docs/document/content/reference/distsql/syntax/reserved-word.en.md
@@ -62,7 +62,7 @@ weight = 3
 
 #### Single Table
 
-`SINGLE`, `STORAGE`, `UNIT`
+`SINGLE`, `STORAGE`, `UNIT`, `COUNT`, `SINGLE_TABLE`
 
 ## Supplement
 
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/single-table/count-single-table-rule.cn.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/single-table/count-single-table-rule.cn.md
new file mode 100644
index 00000000000..3a214b9ac2d
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/single-table/count-single-table-rule.cn.md
@@ -0,0 +1,57 @@
++++
+title = "COUNT SINGLE_TABLE RULE"
+weight = 4
++++
+
+### 描述
+
+`COUNT SINGLE_TABLE RULE` 语法用于查询指定逻辑库中的单表规则个数。
+
+### 语法
+
+```
+CountSingleTableRule::=
+  'COUNT' 'SINGLE_TABLE' 'RULE' ('FROM' databaseName)?
+  
+databaseName ::=
+  identifier
+```
+
+### 补充说明
+
+- 未指定 `databaseName` 时,默认是当前使用的 `DATABASE`。 如果也未使用 `DATABASE` 则会提示 `No database selected`。
+
+### 返回值说明
+
+| 列        | 说明                 |
+|-----------|---------------------|
+| rule_name | 规则名称              |
+| database  | 单表所在的数据库名称    |
+| count     | 规则个数              |
+
+### 示例
+
+- 查询当前逻辑库中的单表规则个数
+
+```sql
+COUNT SINGLE_TABLE RULE
+```
+
+```sql
+mysql> COUNT SINGLE_TABLE RULE;
++--------------+----------+-------+
+| rule_name    | database | count |
++--------------+----------+-------+
+| t_single_0   | ds       | 2     |
++--------------+----------+-------+
+1 row in set (0.02 sec)
+```
+
+### 保留字
+
+`COUNT`、`SINGLE_TABLE`、`RULE`
+
+### 相关链接
+
+- [保留字](/cn/reference/distsql/syntax/reserved-word/)
+
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/single-table/count-single-table-rule.en.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/single-table/count-single-table-rule.en.md
new file mode 100644
index 00000000000..86c9bf495f3
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/single-table/count-single-table-rule.en.md
@@ -0,0 +1,56 @@
++++
+title = "COUNT SINGLE_TABLE RULE"
+weight = 4
++++
+
+### Description
+
+The `COUNT SINGLE_TABLE RULE` syntax is used to query number of single table rules for specified database.
+
+### Syntax
+
+```
+CountSingleTableRule::=
+  'COUNT' 'SINGLE_TABLE' 'RULE' ('FROM' databaseName)?
+  
+databaseName ::=
+  identifier
+```
+
+### Supplement
+
+- When `databaseName` is not specified, the default is the currently used `DATABASE`. If `DATABASE` is not used, `No database selected` will be prompted.
+
+### Return Value Description
+
+| Column    | Description                                         |
+|-----------|-----------------------------------------------------|
+| rule_name | Single table rule name                              |
+| database  | The database name where the single table is located |
+| count     | The count of single table rules                     |
+
+### Example
+
+- Query the number of single table rules for specified database.
+
+```sql
+COUNT SINGLE_TABLE RULE
+``` 
+
+```sql
+mysql> COUNT SINGLE_TABLE RULE;
++--------------+----------+-------+
+| rule_name    | database | count |
++--------------+----------+-------+
+| t_single_0   | ds       | 2     |
++--------------+----------+-------+
+1 row in set (0.02 sec)
+```
+
+### Reserved word
+
+`COUNT`, `SINGLE_TABLE`, `RULE`
+
+### Related links
+
+- [Reserved word](/en/reference/distsql/syntax/reserved-word/)
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/single-table/show-deafult-single-table-storage-unit.cn.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/single-table/show-deafult-single-table-storage-unit.cn.md
index a9a1db5556f..d6ccf21f8dc 100644
--- a/docs/document/content/reference/distsql/syntax/rql/rule-query/single-table/show-deafult-single-table-storage-unit.cn.md
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/single-table/show-deafult-single-table-storage-unit.cn.md
@@ -10,7 +10,7 @@ weight = 2
 ### 语法
 
 ```
-ShowEncryptRule::=
+ShowDefaultSingleTableStorageUnit::=
   'SHOW' 'DEFAULT' 'SINGLE' 'TABLE' 'STORAGE' 'UNIT' ('FROM' databaseName)?
   
 databaseName ::=
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/single-table/show-deafult-single-table-storage-unit.en.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/single-table/show-deafult-single-table-storage-unit.en.md
index f2db19ca8e6..402ab5b59b4 100644
--- a/docs/document/content/reference/distsql/syntax/rql/rule-query/single-table/show-deafult-single-table-storage-unit.en.md
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/single-table/show-deafult-single-table-storage-unit.en.md
@@ -10,7 +10,7 @@ The `SHOW DEFAULT SINGLE TABLE STORAGE UNIT` syntax is used to query storage uni
 ### Syntax
 
 ```
-ShowEncryptRule::=
+ShowDefaultSingleTableStorageUnit::=
   'SHOW' 'DEFAULT' 'SINGLE' 'TABLE' 'STORAGE' 'UNIT' ('FROM' databaseName)?
   
 databaseName ::=
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/single-table/show-single-table.en.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/single-table/show-single-table.en.md
index 052dee19b8b..c9bea40efbc 100644
--- a/docs/document/content/reference/distsql/syntax/rql/rule-query/single-table/show-single-table.en.md
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/single-table/show-single-table.en.md
@@ -1,6 +1,6 @@
 +++
 title = "SHOW SINGLE TABLE"
-weight = 2
+weight = 3
 +++
 
 ### Description