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 9c7d3adbaad Add `refresh database metadata` DistSQL document (#23291)
9c7d3adbaad is described below

commit 9c7d3adbaad37a5c91980382aec0511869fab108
Author: Zichao <[email protected]>
AuthorDate: Tue Jan 3 21:19:06 2023 +1300

    Add `refresh database metadata` DistSQL document (#23291)
---
 .../syntax/ral/refresh-database-metadata.cn.md     | 53 ++++++++++++++++++++++
 .../syntax/ral/refresh-database-metadata.en.md     | 53 ++++++++++++++++++++++
 .../refresh-table-metadata-from-storage-unit.cn.md | 49 --------------------
 .../refresh-table-metadata-from-storage-unit.en.md | 48 --------------------
 .../syntax/ral/refresh-table-metadata.cn.md        | 25 ++++++++--
 .../syntax/ral/refresh-table-metadata.en.md        | 20 +++++++-
 6 files changed, 146 insertions(+), 102 deletions(-)

diff --git 
a/docs/document/content/reference/distsql/syntax/ral/refresh-database-metadata.cn.md
 
b/docs/document/content/reference/distsql/syntax/ral/refresh-database-metadata.cn.md
new file mode 100644
index 00000000000..06bce5805b9
--- /dev/null
+++ 
b/docs/document/content/reference/distsql/syntax/ral/refresh-database-metadata.cn.md
@@ -0,0 +1,53 @@
++++
+title = "REFRESH DATABASE METADATA FROM GOVERNANCE CENTER"
+weight = 7
++++
+
+### 描述
+
+`REFRESH DATABASE METADATA FROM GOVERNANCE CENTER` 语法用于从治理中心拉取最新配置,刷新本地逻辑库元数据
+
+### 语法
+
+{{< tabs >}}
+{{% tab name="语法" %}}
+```sql
+RefreshDatabaseMetadataFromGovernanceCenter ::=
+  'REFRESH' 'DATABASE' 'METADATA' databaseName? 'FROM' 'GOVERNANCE' 'CENTER'
+
+databaseName ::=
+  identifier
+```
+{{% /tab %}}
+{{% tab name="铁路图" %}}
+<iframe frameborder="0" name="diagram" id="diagram" width="100%" 
height="100%"></iframe>
+{{% /tab %}}
+{{< /tabs >}}
+
+### 补充说明
+
+- 未指定 `databaseName` 时,默认刷新所有逻辑库的元数据
+
+- 刷新元数据需要使用 `DATABASE` 如果未使用 `DATABASE` 则会提示 `No database selected`
+
+### 示例
+
+- 刷新指定逻辑库的元数据
+
+```sql
+REFRESH DATABASE METADATA sharding_db FROM GOVERNANCE CENTER;
+```
+
+- 刷新所有逻辑库的元数据
+
+```sql
+REFRESH DATABASE METADATA FROM GOVERNANCE CENTER;
+```
+
+### 保留字
+
+`REFRESH`、`DATABASE`、`METADATA`、`FROM`、`GOVERNANCE`、`CENTER`
+
+### 相关链接
+
+- [保留字](/cn/reference/distsql/syntax/reserved-word/)
\ No newline at end of file
diff --git 
a/docs/document/content/reference/distsql/syntax/ral/refresh-database-metadata.en.md
 
b/docs/document/content/reference/distsql/syntax/ral/refresh-database-metadata.en.md
new file mode 100644
index 00000000000..5b38f263ca7
--- /dev/null
+++ 
b/docs/document/content/reference/distsql/syntax/ral/refresh-database-metadata.en.md
@@ -0,0 +1,53 @@
++++
+title = "REFRESH DATABASE METADATA FROM GOVERNANCE CENTER"
+weight = 7
++++
+
+### Description
+
+The `REFRESH DATABASE METADATA FROM GOVERNANCE CENTER` syntax is used to pull 
the latest configuration from the governance center and refresh the metadata of 
the local logic database.
+
+### Syntax
+
+{{< tabs >}}
+{{% tab name="Grammar" %}}
+```sql
+RefreshDatabaseMetadataFromGovernanceCenter ::=
+  'REFRESH' 'DATABASE' 'METADATA' databaseName? 'FROM' 'GOVERNANCE' 'CENTER'
+
+databaseName ::=
+  identifier
+```
+{{% /tab %}}
+{{% tab name="Railroad diagram" %}}
+<iframe frameborder="0" name="diagram" id="diagram" width="100%" 
height="100%"></iframe>
+{{% /tab %}}
+{{< /tabs >}}
+
+### Supplement
+
+- When `databaseName` is not specified, the default is to refresh all database 
metadata.
+
+- refresh table metadata need to use `DATABASE`. If `DATABASE` is not used, 
`No database selected` will be prompted.
+
+### Example
+
+- Refresh metadata for specified database
+
+```sql
+REFRESH DATABASE METADATA sharding_db FROM GOVERNANCE CENTER;
+```
+
+- Refresh all database metadata
+
+```sql
+REFRESH DATABASE METADATA FROM GOVERNANCE CENTER;
+```
+
+### Reserved word
+
+`REFRESH`, `DATABASE`, `METADATA`, `FROM`, `GOVERNANCE`, `CENTER`
+
+### Related links
+
+- [Reserved word](/en/reference/distsql/syntax/reserved-word/)
diff --git 
a/docs/document/content/reference/distsql/syntax/ral/refresh-table-metadata-from-storage-unit.cn.md
 
b/docs/document/content/reference/distsql/syntax/ral/refresh-table-metadata-from-storage-unit.cn.md
deleted file mode 100644
index 4e34c0f8666..00000000000
--- 
a/docs/document/content/reference/distsql/syntax/ral/refresh-table-metadata-from-storage-unit.cn.md
+++ /dev/null
@@ -1,49 +0,0 @@
-+++
-title = "REFRESH TABLE METADATA FROM STORAGE UNIT"
-weight = 7
-+++
-
-### 描述
-
-`REFRESH TABLE METADATA FROM STORAGE UNIT` 语法用于刷新指定存储单元中指定 `SCHEMA` 中表的元数据
-
-### 语法
-
-{{< tabs >}}
-{{% tab name="语法" %}}
-```sql
-RefreshTableMetadataFromStorageUnit ::=
-  'REFRESH' 'TABLE' 'METADATA' 'FROM' 'STORAGE' 'UNIT' storageUnitName 
'SCHEMA' schemaName
-
-storageUnitName ::=
-  identifier
-
-schemaName ::=
-  identifier
-```
-{{% /tab %}}
-{{% tab name="铁路图" %}}
-<iframe frameborder="0" name="diagram" id="diagram" width="100%" 
height="100%"></iframe>
-{{% /tab %}}
-{{< /tabs >}}
-
-
-### 补充说明
-
-- 如果 `SCHEMA` 中不存在表,则会删除该 `SCHEMA`
-
-### 示例
-
-- 刷新指定存储单元中指定 `SCHEMA` 中表的元数据
-
-```sql
-REFRESH TABLE METADATA FROM STORAGE UNIT ds_1 SCHEMA db_schema;
-```
-
-### 保留字
-
-`REFRESH`、`TABLE`、`METADATA`、`FROM`、`STORAGE`、`UNIT`、`SCHEMA`
-
-### 相关链接
-
-- [保留字](/cn/reference/distsql/syntax/reserved-word/)
\ No newline at end of file
diff --git 
a/docs/document/content/reference/distsql/syntax/ral/refresh-table-metadata-from-storage-unit.en.md
 
b/docs/document/content/reference/distsql/syntax/ral/refresh-table-metadata-from-storage-unit.en.md
deleted file mode 100644
index 9ec19bfc8b0..00000000000
--- 
a/docs/document/content/reference/distsql/syntax/ral/refresh-table-metadata-from-storage-unit.en.md
+++ /dev/null
@@ -1,48 +0,0 @@
-+++
-title = "REFRESH TABLE METADATA FROM STORAGE UNIT"
-weight = 7
-+++
-
-### Description
-
-The `REFRESH TABLE METADATA FROM STORAGE UNIT` syntax is used to Refresh the 
tables’ metadata in a schema of a specified storage unit.
-
-### Syntax
-
-{{< tabs >}}
-{{% tab name="Grammar" %}}
-```sql
-RefreshTableMetadataFromStorageUnit ::=
-  'REFRESH' 'TABLE' 'METADATA' 'FROM' 'STORAGE' 'UNIT' storageUnitName 
'SCHEMA' schemaName
-
-storageUnitName ::=
-  identifier
-
-schemaName ::=
-  identifier
-```
-{{% /tab %}}
-{{% tab name="Railroad diagram" %}}
-<iframe frameborder="0" name="diagram" id="diagram" width="100%" 
height="100%"></iframe>
-{{% /tab %}}
-{{< /tabs >}}
-
-### Supplement
-
-- If there are no tables in the schema, the schema will be deleted
-
-### Example
-
-- Refresh the tables’ metadata in a schema of a specified storage unit
-
-```sql
-REFRESH TABLE METADATA FROM STORAGE UNIT ds_1 SCHEMA db_schema;
-```
-
-### Reserved word
-
-`REFRESH`, `TABLE`, `METADATA`, `FROM`, `STORAGE`, `UNIT`, `SCHEMA`
-
-### Related links
-
-- [Reserved word](/en/reference/distsql/syntax/reserved-word/)
diff --git 
a/docs/document/content/reference/distsql/syntax/ral/refresh-table-metadata.cn.md
 
b/docs/document/content/reference/distsql/syntax/ral/refresh-table-metadata.cn.md
index 7d619ce094a..ef14e72b073 100644
--- 
a/docs/document/content/reference/distsql/syntax/ral/refresh-table-metadata.cn.md
+++ 
b/docs/document/content/reference/distsql/syntax/ral/refresh-table-metadata.cn.md
@@ -13,13 +13,16 @@ weight = 6
 {{% tab name="语法" %}}
 ```sql
 RefreshTableMetadata ::=
-  'REFRESH' 'TABLE' 'METADATA' ((tableName)? | tableName 'FROM' 'STORAGE' 
'UNIT' storageUnitName)?
+  'REFRESH' 'TABLE' 'METADATA' (tableName | tableName 'FROM' 'STORAGE' 'UNIT' 
storageUnitName ('SCHEMA' schemaName)?)?
 
 tableName ::=
   identifier
 
 storageUnitName ::=
   identifier
+
+schemaName ::=
+  identifier
 ```
 {{% /tab %}}
 {{% tab name="铁路图" %}}
@@ -29,13 +32,27 @@ storageUnitName ::=
 
 ### 补充说明
 
-- 未指定 `tableName` 和 `storageUnitName` 时,默认刷新所有表的元数据
+- 未指定 `tableName` 和 `storageUnitName` 时,默认刷新所有表的元数据;
+
+- 刷新元数据需要使用 `DATABASE` 如果未使用 `DATABASE` 则会提示 `No database selected`;
 
-- 刷新元数据需要使用 `DATABASE` 如果未使用 `DATABASE` 则会提示 `No database selected`
+- 如果 `SCHEMA` 中不存在表,则会删除该 `SCHEMA`。
 
 ### 示例
 
-- 刷新指定存储单于中指定表的元数据
+- 刷新指定存储单元中指定 `SCHEMA` 中指定表的元数据
+
+```sql
+REFRESH TABLE METADATA t_order FROM STORAGE UNIT ds_1 SCHEMA db_schema;
+```
+
+- 刷新指定存储单元中指定 `SCHEMA` 中所有表的元数据
+
+```sql
+REFRESH TABLE METADATA FROM STORAGE UNIT ds_1 SCHEMA db_schema;
+```
+
+- 刷新指定存储单元中指定表的元数据
 
 ```sql
 REFRESH TABLE METADATA t_order FROM STORAGE UNIT ds_1;
diff --git 
a/docs/document/content/reference/distsql/syntax/ral/refresh-table-metadata.en.md
 
b/docs/document/content/reference/distsql/syntax/ral/refresh-table-metadata.en.md
index 17267c28935..86d174bb306 100644
--- 
a/docs/document/content/reference/distsql/syntax/ral/refresh-table-metadata.en.md
+++ 
b/docs/document/content/reference/distsql/syntax/ral/refresh-table-metadata.en.md
@@ -13,13 +13,16 @@ The `REFRESH TABLE METADATA` syntax is used to refresh 
table metadata.
 {{% tab name="Grammar" %}}
 ```sql
 RefreshTableMetadata ::=
-  'REFRESH' 'TABLE' 'METADATA' ((tableName)? | tableName 'FROM' 'STORAGE' 
'UNIT' storageUnitName)?
+  'REFRESH' 'TABLE' 'METADATA' (tableName | tableName 'FROM' 'STORAGE' 'UNIT' 
storageUnitName ('SCHEMA' schemaName)?)?
 
 tableName ::=
   identifier
 
 storageUnitName ::=
   identifier
+
+schemaName ::=
+  identifier
 ```
 {{% /tab %}}
 {{% tab name="Railroad diagram" %}}
@@ -33,8 +36,23 @@ storageUnitName ::=
 
 - refresh table metadata need to use `DATABASE`. If `DATABASE` is not used, 
`No database selected` will be prompted.
 
+- If there are no tables in the schema, the schema will be deleted.
+
+
 ### Example
 
+- Refresh specified table's metadata in specified schema of a specified 
storage unit
+
+```sql
+REFRESH TABLE METADATA t_order FROM STORAGE UNIT ds_1 SCHEMA db_schema;
+```
+
+- Refresh all tables' metadata in specified schema of a specified storage unit
+
+```sql
+REFRESH TABLE METADATA FROM STORAGE UNIT ds_1 SCHEMA db_schema;
+```
+
 - Refresh metadata for specified table in specified storage unit
 
 ```sql

Reply via email to