You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/04/08 07:33:12 UTC

[GitHub] [shardingsphere] lanchengx opened a new pull request, #16659: Refactor DistSQL documentation

lanchengx opened a new pull request, #16659:
URL: https://github.com/apache/shardingsphere/pull/16659

   Changes proposed in this pull request:
   - `ADD RESOURCE` syntax
   - Reserved word
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] RaigorJiang commented on a diff in pull request #16659: Refactor DistSQL doc

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on code in PR #16659:
URL: https://github.com/apache/shardingsphere/pull/16659#discussion_r845840186


##########
docs/document/content/reference/distsql/syntax/rdl/add-resource.en.md:
##########
@@ -0,0 +1,97 @@
++++
+title = "RDL Syntax"
+weight = 2
++++
+
+
+## ADD RESOURCE
+
+The `ADD RESOURCE` syntax is used to add resources for the currently selected schema.
+
+
+
+### Syntax
+```SQL
+AddResource ::=
+  'ADD' '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 adding resources, please confirm that a schema has been created in Proxy, and execute the `use` command to successfully select a schema
+- Confirm that the added resource can be connected normally, otherwise it will not be added successfully
+- `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
+- String mode is recommended when `password` contains special characters
+
+ ### Example
+- Add resources using standard mode
+```SQL
+ADD RESOURCE ds_0 (
+    HOST=127.0.0.1,
+    PORT=3306,
+    DB=db_0,
+    USER=root,
+    PASSWORD=root
+);
+```
+
+- Add resources and set connection pool parameters using standard mode

Review Comment:
   Hi @lanchengx  Because there is only one resource in code example, I think `Add resource` is enough.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] RaigorJiang merged pull request #16659: Refactor DistSQL doc

Posted by GitBox <gi...@apache.org>.
RaigorJiang merged PR #16659:
URL: https://github.com/apache/shardingsphere/pull/16659


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org