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

lanchengxiang 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 7dde4e14195 SHOW USED RESOURCE (#18022)
7dde4e14195 is described below

commit 7dde4e14195f3542e9c6f3d67c60465c51bc6800
Author: Swastika Gupta <[email protected]>
AuthorDate: Tue May 31 07:29:27 2022 +0530

    SHOW USED RESOURCE (#18022)
---
 .../rql/resource-query/show-used-resource.en.md    | 64 ++++++++++++++++++++++
 1 file changed, 64 insertions(+)

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
new file mode 100644
index 00000000000..4140757f36f
--- /dev/null
+++ 
b/docs/document/content/reference/distsql/syntax/rql/resource-query/show-used-resource.en.md
@@ -0,0 +1,64 @@
++++
+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 schema.
+
+### Syntax
+
+```SQL
+ShowUsedResource ::=
+  'SHOW' 'USED' '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
+
+| 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 schema
+
+```sql
+SHOW USED 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)
+```
+
+- Query resources for the current schema
+```sql
+SHOW USED 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)
+```

Reply via email to