You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2022/07/05 14:50:02 UTC

[shardingsphere] branch master updated: Add SHOW RULES USED RESOURCE document. (#18873)

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

zhangliang 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 3aaa64b694c Add SHOW RULES USED RESOURCE document. (#18873)
3aaa64b694c is described below

commit 3aaa64b694c0802688c7abb8bce6dc41477612e6
Author: yx9o <ya...@163.com>
AuthorDate: Tue Jul 5 22:49:57 2022 +0800

    Add SHOW RULES USED RESOURCE document. (#18873)
---
 .../resource-query/show-rules-used-resource.cn.md  | 62 +++++++++++++++++++++
 .../resource-query/show-rules-used-resource.en.md  | 62 +++++++++++++++++++++
 .../rql/resource-query/show-used-resource.en.md    | 64 ----------------------
 3 files changed, 124 insertions(+), 64 deletions(-)

diff --git a/docs/document/content/reference/distsql/syntax/rql/resource-query/show-rules-used-resource.cn.md b/docs/document/content/reference/distsql/syntax/rql/resource-query/show-rules-used-resource.cn.md
new file mode 100644
index 00000000000..018511bafd9
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/resource-query/show-rules-used-resource.cn.md
@@ -0,0 +1,62 @@
++++
+title = "SHOW RULES USED RESOURCE"
+weight = 4
++++
+
+### 描述
+
+`SHOW RULES USED RESOURCE` 语法用于查询指定逻辑库中使用指定资源的规则。
+
+### 语法
+
+```SQL
+showRulesUsedResource ::=
+  'SHOW' 'RULES' 'USED' 'RESOURCES' resourceName ('FROM' databaseName)?
+
+resourceName ::=
+  IDENTIFIER | STRING
+
+databaseName ::=
+  IDENTIFIER
+```
+
+### 特别说明
+
+- 未指定 `databaseName` 时, 默认是当前使用的 `DATABASE`; 如未使用 `DATABASE` 则会提示 `No database selected`。
+
+### 返回值说明
+
+| 列        | 说明       |
+| --------- | --------- |
+| type      | 特性       |
+| name      | 数据源名称  |
+
+### 示例
+
+- 查询指定逻辑库中使用指定资源的规则
+```sql
+SHOW RULES USED RESOURCE ds_0 FROM sharding_db;
+```
+```sql
++----------+--------------+
+| type     | name         |
++----------+--------------+
+| sharding | t_order      |
+| sharding | t_order_item |
++----------+--------------+
+2 rows in set (0.00 sec)
+```
+
+- 查询当前逻辑库中使用指定资源的规则
+```sql
+SHOW RULES USED RESOURCE ds_0;
+```
+```sql
++----------+--------------+
+| type     | name         |
++----------+--------------+
+| sharding | t_order      |
+| sharding | t_order_item |
++----------+--------------+
+2 rows in set (0.00 sec)
+```
diff --git a/docs/document/content/reference/distsql/syntax/rql/resource-query/show-rules-used-resource.en.md b/docs/document/content/reference/distsql/syntax/rql/resource-query/show-rules-used-resource.en.md
new file mode 100644
index 00000000000..c89034b1fe4
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/resource-query/show-rules-used-resource.en.md
@@ -0,0 +1,62 @@
++++
+title = "SHOW RULES USED RESOURCE"
+weight = 4
++++
+
+### Description
+
+The `SHOW RULES USED RESOURCE` syntax is used to query the rules that use the specified resource in the specified database.
+
+### Syntax
+
+```SQL
+showRulesUsedResource ::=
+  'SHOW' 'RULES' 'USED' 'RESOURCES' resourceName ('FROM' databaseName)?
+
+resourceName ::=
+  IDENTIFIER | STRING
+
+databaseName ::=
+  IDENTIFIER
+```
+
+### Supplement
+
+- When `databaseName` is not specified, the default is the currently used `DATABASE`; if `DATABASE` is not used, it will prompt `No database selected`.
+
+### Return Value Description
+
+| Column    | Description           |
+| --------- | --------------------- |
+| type      | features              |
+| name      | Data source name      |
+
+### Example
+
+- Query the rules that use the specified resource in the specified database
+```sql
+SHOW RULES USED RESOURCE ds_0 FROM sharding_db;
+```
+```sql
++----------+--------------+
+| type     | name         |
++----------+--------------+
+| sharding | t_order      |
+| sharding | t_order_item |
++----------+--------------+
+2 rows in set (0.00 sec)
+```
+
+- Query the rules that use the specified resource in the current database
+```sql
+SHOW RULES USED RESOURCE ds_0;
+```
+```sql
++----------+--------------+
+| type     | name         |
++----------+--------------+
+| sharding | t_order      |
+| sharding | t_order_item |
++----------+--------------+
+2 rows in set (0.00 sec)
+```
diff --git a/docs/document/content/reference/distsql/syntax/rql/resource-query/show-used-resource.en.md b/docs/document/content/reference/distsql/syntax/rql/resource-query/show-used-resource.en.md
deleted file mode 100644
index 0ba7d62f4c2..00000000000
--- a/docs/document/content/reference/distsql/syntax/rql/resource-query/show-used-resource.en.md
+++ /dev/null
@@ -1,64 +0,0 @@
-+++
-title = "SHOW USED RESOURCE"
-weight = 4
-+++
-
-### Description
-
-The `SHOW USED RESOURCE` syntax is used to query the resources that have been added to the specified database.
-
-### Syntax
-
-```SQL
-ShowUsedResource ::=
-  'SHOW' 'USED' 'DATABASE' 'RESOURCES' ('FROM' databaseName)?
-
-databaseName ::=
-  identifier
-```
-
-### Supplement
-
-- When `databaseName` is not specified, the default is the currently used `DATABASE`; if `DATABASE` is not used, it will prompt `No database selected`.
-
- ### Return Value Description
-
-| Column    | Description           |
-| --------- | --------------------- |
-| name      | Data source name      |
-| type      | Data source type      |
-| host      | Data source host      |
-| port      | Data source port      |
-| db        | Database name         |
-| attribute | Data source attribute |
-
- ### Example
-
-- Query resources for the specified database
-
-```sql
-SHOW USED DATABASE RESOURCES FROM sharding_db;
-```
-```sql
-+------+-------+-----------+------+------+---------------------------------+---------------------------+---------------------------+---------------+---------------+-----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
-| name | type  | host      | port | db   | connection_timeout_milliseconds | idle_timeout_milliseconds | max_lifetime_milliseconds | max_pool_size | min_pool_size | read_only | other_attributes                                                                                                                                                                                                                                                                                                            [...]
-+------+-------+-----------+------+------+---------------------------------+---------------------------+---------------------------+---------------+---------------+-----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
-| ds_0 | MySQL | 127.0.0.1 | 3306 | db_0 | 30000                           | 60000                     | 1800000                   | 50            | 1             | false     | {"dataSourceProperties":{"cacheServerConfiguration":"true","elideSetAutoCommits":"true","useServerPrepStmts":"true","cachePrepStmts":"true","rewriteBatchedStatements":"true","cacheResultSetMetadata":"false","useLocalSessionState":"true","maintainTimeStats":"false","prepStmtCacheSize":"200000","tinyInt1isBit":"fals [...]
-| ds_1 | MySQL | 127.0.0.1 | 3306 | db_1 | 30000                           | 60000                     | 1800000                   | 50            | 1             | false     | {"dataSourceProperties":{"cacheServerConfiguration":"true","elideSetAutoCommits":"true","useServerPrepStmts":"true","cachePrepStmts":"true","rewriteBatchedStatements":"true","cacheResultSetMetadata":"false","useLocalSessionState":"true","maintainTimeStats":"false","prepStmtCacheSize":"200000","tinyInt1isBit":"fals [...]
-+------+-------+-----------+------+------+---------------------------------+---------------------------+---------------------------+---------------+---------------+-----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
-2 rows in set (0.26 sec)
-```
-
-- Query resources for the current database
-```sql
-SHOW USED DATABASE RESOURCES;
-```
-```sql
-+------+-------+-----------+------+------+---------------------------------+---------------------------+---------------------------+---------------+---------------+-----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
-| name | type  | host      | port | db   | connection_timeout_milliseconds | idle_timeout_milliseconds | max_lifetime_milliseconds | max_pool_size | min_pool_size | read_only | other_attributes                                                                                                                                                                                                                                                                                                            [...]
-+------+-------+-----------+------+------+---------------------------------+---------------------------+---------------------------+---------------+---------------+-----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
-| ds_0 | MySQL | 127.0.0.1 | 3306 | db_0 | 30000                           | 60000                     | 1800000                   | 50            | 1             | false     | {"dataSourceProperties":{"cacheServerConfiguration":"true","elideSetAutoCommits":"true","useServerPrepStmts":"true","cachePrepStmts":"true","rewriteBatchedStatements":"true","cacheResultSetMetadata":"false","useLocalSessionState":"true","maintainTimeStats":"false","prepStmtCacheSize":"200000","tinyInt1isBit":"fals [...]
-| ds_1 | MySQL | 127.0.0.1 | 3306 | db_1 | 30000                           | 60000                     | 1800000                   | 50            | 1             | false     | {"dataSourceProperties":{"cacheServerConfiguration":"true","elideSetAutoCommits":"true","useServerPrepStmts":"true","cachePrepStmts":"true","rewriteBatchedStatements":"true","cacheResultSetMetadata":"false","useLocalSessionState":"true","maintainTimeStats":"false","prepStmtCacheSize":"200000","tinyInt1isBit":"fals [...]
-+------+-------+-----------+------+------+---------------------------------+---------------------------+---------------------------+---------------+---------------+-----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [...]
-2 rows in set (0.26 sec)
-```