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 869c2354c01 ALTER Resources (#18079)
869c2354c01 is described below

commit 869c2354c01834d29ee53a9874b4cdee627a1cdb
Author: Swastika Gupta <[email protected]>
AuthorDate: Thu Jun 2 07:23:41 2022 +0530

    ALTER Resources (#18079)
    
    * ALTER Resources
    
    * Update alter-resource.en.md
---
 .../rdl/resource-definition/alter-resource.en.md   | 91 ++++++++++++++++++++++
 .../rdl/resource-definition/drop-resource.cn.md    |  2 +-
 .../rdl/resource-definition/drop-resource.en.md    |  2 +-
 3 files changed, 93 insertions(+), 2 deletions(-)

diff --git 
a/docs/document/content/reference/distsql/syntax/rdl/resource-definition/alter-resource.en.md
 
b/docs/document/content/reference/distsql/syntax/rdl/resource-definition/alter-resource.en.md
new file mode 100644
index 00000000000..1141a5414c9
--- /dev/null
+++ 
b/docs/document/content/reference/distsql/syntax/rdl/resource-definition/alter-resource.en.md
@@ -0,0 +1,91 @@
++++
+title = "ALTER RESOURCE"
+weight = 3
++++
+
+
+### Description
+
+The `ALTER RESOURCE` syntax is used to alter resources for the currently 
selected schema.
+
+
+
+### Syntax
+```SQL
+AlterResource ::=
+  'ALTER' 'RESOURCE' dataSource (',' dataSource)*
+
+dataSource ::=
+  dataSourceName '(' ( 'HOST' '=' hostName ',' 'PORT' '=' port ',' 'DB' '=' 
dbName  |  'URL' '=' url  ) ',' 'USER' '=' user (',' 'PASSWORD' '=' password )? 
 (',' 'PROPERTIES'  '(' ( key  '=' value ) ( ',' key  '=' value )* ')'  )?')'
+
+dataSourceName ::=
+  identifier
+
+hostname ::=
+  identifier | ip
+
+dbName ::=
+  identifier
+
+port ::=
+  int
+
+password ::=
+  identifier | int | string 
+
+user ::=
+  identifier
+
+url ::=
+  identifier | string
+
+```
+
+ ### Supplement
+- Before altering the resources, please confirm that a schema exists in Proxy, 
and execute the `use` command to successfully select a schema
+- `dataSourceName` is case-sensitive
+- `dataSourceName` needs to be unique within the current schema
+- `dataSourceName` name only allows letters, numbers and `_`, and must start 
with a letter
+- `poolProperty` is used to customize connection pool parameters, `key` must 
be the same as the connection pool parameter name, `value` supports int and 
String types
+- When `password` contains special characters, it is recommended to use the 
string form; for example, the string form of `password@123` is `"password@123"`
+
+ ### Example
+- Alter resource using standard mode
+```SQL
+ALTER RESOURCE ds_0 (
+    HOST=127.0.0.1,
+    PORT=3306,
+    DB=db_0,
+    USER=root,
+    PASSWORD=root
+);
+```
+
+- Alter resource and set connection pool parameters using standard mode
+```SQL
+ALTER RESOURCE ds_1 (
+    HOST=127.0.0.1,
+    PORT=3306,
+    DB=db_1,
+    USER=root,
+    PASSWORD=root
+    PROPERTIES("maximumPoolSize"=10)
+);
+```
+
+- Alter resource and set connection pool parameters using URL patterns
+```SQL
+ALTER RESOURCE ds_2 (
+    URL="jdbc:mysql://127.0.0.1:3306/db_2?serverTimezone=UTC&useSSL=false",
+    USER=root,
+    PASSWORD=root,
+    PROPERTIES("maximumPoolSize"=10,"idleTimeout"="30000")
+);
+```
+
+### Reserved word
+
+    ALTER, RESOURCE, HOST, PORT, DB, USER, PASSWORD, PROPERTIES, URL
+
+ ### Related links
+- [Reserved word](/en/reference/distsql/syntax/reserved-word/)
diff --git 
a/docs/document/content/reference/distsql/syntax/rdl/resource-definition/drop-resource.cn.md
 
b/docs/document/content/reference/distsql/syntax/rdl/resource-definition/drop-resource.cn.md
index 919cdb3be54..f09d923a612 100644
--- 
a/docs/document/content/reference/distsql/syntax/rdl/resource-definition/drop-resource.cn.md
+++ 
b/docs/document/content/reference/distsql/syntax/rdl/resource-definition/drop-resource.cn.md
@@ -1,6 +1,6 @@
 +++
 title = "DROP RESOURCE"
-weight = 3
+weight = 4
 +++
 
 ### 描述
diff --git 
a/docs/document/content/reference/distsql/syntax/rdl/resource-definition/drop-resource.en.md
 
b/docs/document/content/reference/distsql/syntax/rdl/resource-definition/drop-resource.en.md
index 6dbd6654c3f..aac4a0ea675 100644
--- 
a/docs/document/content/reference/distsql/syntax/rdl/resource-definition/drop-resource.en.md
+++ 
b/docs/document/content/reference/distsql/syntax/rdl/resource-definition/drop-resource.en.md
@@ -1,6 +1,6 @@
 +++
 title = "DROP RESOURCE"
-weight = 3
+weight = 4
 +++
 
 ### Description

Reply via email to