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/17 10:52:35 UTC

[shardingsphere] branch master updated: Update RQL show sharding key generators documents (#21613)

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 e37315de863 Update RQL show sharding key generators documents (#21613)
e37315de863 is described below

commit e37315de8637cfb41a0439b0d11b6f54564dfce3
Author: Qianyi951015 <57...@users.noreply.github.com>
AuthorDate: Mon Oct 17 18:52:24 2022 +0800

    Update RQL show sharding key generators documents (#21613)
    
    * Update RQL show default sharding strategy documents
    
    * Update RQL show default sharding strategy documents
    
    * Update RQL show default sharding strategy documents
---
 .../sharding/show-sharding-key-generator.cn.md     | 73 ++++++++++++++++++++++
 .../sharding/show-sharding-key-generator.en.md     | 73 ++++++++++++++++++++++
 2 files changed, 146 insertions(+)

diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-key-generator.cn.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-key-generator.cn.md
new file mode 100644
index 00000000000..e7bde3a2d37
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-key-generator.cn.md
@@ -0,0 +1,73 @@
++++
+title = "SHOW SHARDING KEY GENERATORS"
+weight = 6
++++
+
+### 描述
+
+`SHOW SHARDING KEY GENERATORS` 语法用于查询指定逻辑库的分布式主键生成器。
+
+### 语法
+
+```
+ShowShardingKeyGenerators::=
+  'SHOW' 'SHARDING' 'KEY' 'GENERATOR'('FROM' databaseName)?
+
+databaseName ::=
+  identifier
+```
+
+### 补充说明
+
+- 未指定 `databaseName` 时,默认是当前使用的 `DATABASE`。 如果也未使用 `DATABASE` 则会提示 `No database selected`。
+
+### 返回值说明
+
+| 列                      | 说明                 |
+| -----------------------| ---------------------|
+| name                   | 分布式主键生成器名称    |
+| type                   | 分布式主键生成器类型    |
+| props                  | 分布式主键生成器参数    |
+
+### 示例
+
+- 查询指定逻辑库的分布式主键生成器
+
+```sql
+SHOW SHARDING KEY GENERATORS FROM test1;
+```
+
+```sql
+mysql> SHOW SHARDING KEY GENERATORS FROM test1;
++-------------------------+-----------+-------+
+| name                    | type      | props |
++-------------------------+-----------+-------+
+| snowflake_key_generator | snowflake | {}    |
++-------------------------+-----------+-------+
+1 row in set (0.00 sec)
+```
+
+- 查询当前逻辑库的分布式主键生成器
+
+```sql
+SHOW SHARDING KEY GENERATORS;
+```
+
+```sql
+mysql> SHOW SHARDING KEY GENERATORS;
++-------------------------+-----------+-------+
+| name                    | type      | props |
++-------------------------+-----------+-------+
+| snowflake_key_generator | snowflake | {}    |
++-------------------------+-----------+-------+
+1 row in set (0.00 sec)
+```
+
+### 保留字
+
+`SHOW`、`SHARDING`、`KEY`、`GENERATORS`、`FROM`
+
+### 相关链接
+
+- [保留字](/cn/reference/distsql/syntax/reserved-word/)
+
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-key-generator.en.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-key-generator.en.md
new file mode 100644
index 00000000000..12213687658
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-key-generator.en.md
@@ -0,0 +1,73 @@
++++
+title = "SHOW SHARDING KEY GENERATORS"
+weight = 6
++++
+
+### Description
+
+`SHOW SHARDING KEY GENERATORS` syntax is used to query sharding key generators in specified database.
+
+### Syntax
+
+```
+ShowShardingKeyGenerators::=
+  'SHOW' 'SHARDING' 'KEY' 'GENERATOR'('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                          |
+| -----------------------| -------------------------------------|
+| name                   | Sharding key generator name          |
+| type                   | Sharding key generator type          |
+| props                  | Sharding key generator properties    |
+
+### Example
+
+- Query the sharding key generators of the specified logical database
+
+```sql
+SHOW SHARDING KEY GENERATORS FROM test1;
+```
+
+```sql
+mysql> SHOW SHARDING KEY GENERATORS FROM test1;
++-------------------------+-----------+-------+
+| name                    | type      | props |
++-------------------------+-----------+-------+
+| snowflake_key_generator | snowflake | {}    |
++-------------------------+-----------+-------+
+1 row in set (0.00 sec)
+```
+
+- Query the sharding key generators of the current logical database
+
+```sql
+SHOW SHARDING KEY GENERATORS;
+```
+
+```sql
+mysql> SHOW SHARDING KEY GENERATORS;
++-------------------------+-----------+-------+
+| name                    | type      | props |
++-------------------------+-----------+-------+
+| snowflake_key_generator | snowflake | {}    |
++-------------------------+-----------+-------+
+1 row in set (0.00 sec)
+```
+
+### Reserved word
+
+`SHOW`、`SHARDING`、`KEY`、`GENERATORS`、`FROM`
+
+### Related links
+
+- [Reserved word](/en/reference/distsql/syntax/reserved-word/)
+