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/04/25 06:38:27 UTC

[shardingsphere] branch master updated: `SHOW UNUSED RESOURCE` syntax doc. (#17059)

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 ef1dedcfe72 `SHOW UNUSED RESOURCE` syntax doc. (#17059)
ef1dedcfe72 is described below

commit ef1dedcfe7283027d9c844f1495b54f012a51c2d
Author: lanchengx <52...@users.noreply.github.com>
AuthorDate: Mon Apr 25 14:38:18 2022 +0800

    `SHOW UNUSED RESOURCE` syntax doc. (#17059)
    
    * `SHOW UNUSED RESOURCE` doc.
    
    * Remove extra blank lines.
    
    * Reformat
    
    * `SHOW UNUSED RESOURCE` doc.
---
 .../syntax/rql/resource-query/show-resource.cn.md  |  5 ++--
 .../syntax/rql/resource-query/show-resource.en.md  |  6 ++---
 ...w-resource.cn.md => show-unused-resource.cn.md} | 26 ++++++++++-----------
 ...w-resource.en.md => show-unused-resource.en.md} | 27 +++++++++++-----------
 4 files changed, 31 insertions(+), 33 deletions(-)

diff --git a/docs/document/content/reference/distsql/syntax/rql/resource-query/show-resource.cn.md b/docs/document/content/reference/distsql/syntax/rql/resource-query/show-resource.cn.md
index 3f27ab780a7..13c4925b35b 100644
--- a/docs/document/content/reference/distsql/syntax/rql/resource-query/show-resource.cn.md
+++ b/docs/document/content/reference/distsql/syntax/rql/resource-query/show-resource.cn.md
@@ -8,9 +8,8 @@ weight = 2
 
 `SHOW RESOURCE` 语法用于查询指定逻辑库已经添加的资源。
 
-
-
 ### 语法
+
 ```SQL
 ShowResource ::=
   'SHOW' 'SCHEMA' 'RESOURCES' ('FROM' schemaName)?
@@ -20,6 +19,7 @@ schemaName ::=
 ```
 
 ### 特别说明
+
 - 未指定 `schemaName` 时,默认是当前使用的 `SCHEMA`; 如未使用 `SCHEMA` 则会提示 `No database selected`。
 
  ### 返回值说明
@@ -34,6 +34,7 @@ schemaName ::=
 | attribute | 数据源参数 |
 
  ### 示例
+
 - 查询指定逻辑库的资源
 ```sql
 SHOW SCHEMA RESOURCES FROM sharding_db;
diff --git a/docs/document/content/reference/distsql/syntax/rql/resource-query/show-resource.en.md b/docs/document/content/reference/distsql/syntax/rql/resource-query/show-resource.en.md
index 65b54500dc6..eaa67148a22 100644
--- a/docs/document/content/reference/distsql/syntax/rql/resource-query/show-resource.en.md
+++ b/docs/document/content/reference/distsql/syntax/rql/resource-query/show-resource.en.md
@@ -3,14 +3,12 @@ title = "SHOW RESOURCE"
 weight = 2
 +++
 
-
 ### Description
 
 The `SHOW RESOURCE` syntax is used to query the resources that have been added to the specified schema.
 
-
-
 ### Syntax
+
 ```SQL
 ShowResource ::=
   'SHOW' 'SCHEMA' 'RESOURCES' ('FROM' schemaName)?
@@ -20,6 +18,7 @@ schemaName ::=
 ```
 
 ### Supplement
+
 - When `schemaName` is not specified, the default is the currently used `SCHEMA`; if `SCHEMA` is not used, it will prompt `No database selected`.
 
  ### Return Value Description
@@ -34,6 +33,7 @@ schemaName ::=
 | attribute | Data source attribute |
 
  ### Example
+
 - Query resources for the specified schema
 
 ```sql
diff --git a/docs/document/content/reference/distsql/syntax/rql/resource-query/show-resource.cn.md b/docs/document/content/reference/distsql/syntax/rql/resource-query/show-unused-resource.cn.md
similarity index 82%
copy from docs/document/content/reference/distsql/syntax/rql/resource-query/show-resource.cn.md
copy to docs/document/content/reference/distsql/syntax/rql/resource-query/show-unused-resource.cn.md
index 3f27ab780a7..f736b8e1a11 100644
--- a/docs/document/content/reference/distsql/syntax/rql/resource-query/show-resource.cn.md
+++ b/docs/document/content/reference/distsql/syntax/rql/resource-query/show-unused-resource.cn.md
@@ -1,25 +1,24 @@
 +++
-title = "SHOW RESOURCE"
-weight = 2
+title = "SHOW UNUSED RESOURCE"
+weight = 3
 +++
 
-
 ### 描述
 
-`SHOW RESOURCE` 语法用于查询指定逻辑库已经添加的资源。
-
-
+`SHOW UNUSED RESOURCE` 语法用于查询指定逻辑库中还未被规则引用的资源。
 
 ### 语法
+
 ```SQL
-ShowResource ::=
-  'SHOW' 'SCHEMA' 'RESOURCES' ('FROM' schemaName)?
+ShowUnusedResource ::=
+  'SHOW' 'UNUSED' 'SCHEMA'? 'RESOURCES' ('FROM' schemaName)?
 
 schemaName ::=
   identifier
 ```
 
 ### 特别说明
+
 - 未指定 `schemaName` 时,默认是当前使用的 `SCHEMA`; 如未使用 `SCHEMA` 则会提示 `No database selected`。
 
  ### 返回值说明
@@ -34,30 +33,29 @@ schemaName ::=
 | attribute | 数据源参数 |
 
  ### 示例
+
 - 查询指定逻辑库的资源
 ```sql
-SHOW SCHEMA RESOURCES FROM sharding_db;
+SHOW UNUSED SCHEMA 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)
+1 rows in set (0.26 sec)
 ```
 
 - 查询当前逻辑库的资源 
 ```sql
-SHOW SCHEMA RESOURCES;
+SHOW UNUSED SCHEMA 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)
+1 rows in set (0.26 sec)
 ```
diff --git a/docs/document/content/reference/distsql/syntax/rql/resource-query/show-resource.en.md b/docs/document/content/reference/distsql/syntax/rql/resource-query/show-unused-resource.en.md
similarity index 81%
copy from docs/document/content/reference/distsql/syntax/rql/resource-query/show-resource.en.md
copy to docs/document/content/reference/distsql/syntax/rql/resource-query/show-unused-resource.en.md
index 65b54500dc6..e3fe4765e76 100644
--- a/docs/document/content/reference/distsql/syntax/rql/resource-query/show-resource.en.md
+++ b/docs/document/content/reference/distsql/syntax/rql/resource-query/show-unused-resource.en.md
@@ -1,25 +1,24 @@
 +++
-title = "SHOW RESOURCE"
-weight = 2
+title = "SHOW UNUSED RESOURCE"
+weight = 3
 +++
 
-
 ### Description
 
-The `SHOW RESOURCE` syntax is used to query the resources that have been added to the specified schema.
-
-
+The `SHOW UNUSED RESOURCE` syntax is used to query resources in the specified schema that have not been referenced by rules.
 
 ### Syntax
+
 ```SQL
-ShowResource ::=
-  'SHOW' 'SCHEMA' 'RESOURCES' ('FROM' schemaName)?
+ShowUnusedResource ::=
+  'SHOW' 'UNUSED' 'SCHEMA'? 'RESOURCES' ('FROM' schemaName)?
 
 schemaName ::=
   identifier
 ```
 
 ### Supplement
+
 - When `schemaName` is not specified, the default is the currently used `SCHEMA`; if `SCHEMA` is not used, it will prompt `No database selected`.
 
  ### Return Value Description
@@ -34,31 +33,31 @@ schemaName ::=
 | attribute | Data source attribute |
 
  ### Example
+
 - Query resources for the specified schema
 
 ```sql
-SHOW SCHEMA RESOURCES FROM sharding_db;
+SHOW UNUSED SCHEMA 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)
+1 rows in set (0.26 sec)
 ```
 
 - Query resources for the current schema
+
 ```sql
-SHOW SCHEMA RESOURCES;
+SHOW UNUSED SCHEMA 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)
+1 rows in set (0.26 sec)
 ```