Metadata #
Syntax | Description | Type |
---|---|---|
SHOW TABLE METADATA tableName [, tableName] … | Query table metadata | RQL |
REFRESH TABLE METADATA | Refresh table metadata | RUL |
REFRESH DATABASE METADATA schemaName FROM GOVERNANCE CENTER | Refresh specified logical database metadata | RUL |
IMPORT DATABASE CONFIGURATION | Import the configuration in YAML into the database, and only support the import operation for empty databases | RUL |
EXPORT DATABASE CONFIGURATION | Export the data source and rule configuration in the database to YAML format | RUL |
1. Query Table Metadata #
SHOW TABLE METADATA tableName [, tableName] …
Parameter Explanation
None
Example
SHOW TABLE METADATA t_order;
2. Refresh Table Metadata #
REFRESH TABLE METADATA
Example
Refresh metadata for all tables
REFRESH TABLE METADATA
Refresh metadata for specified table
REFRESH TABLE METADATA t_order
Refresh metadata for specified table in specified data source
REFRESH TABLE METADATA t_order FROM STORAGE UNIT ds_1
Refresh metadata for specified table in specified schema, if there is no table in the schema,the schema will be deleted
REFRESH TABLE METADATA FROM STORAGE UNIT ds_1 SCHEMA db_schema
3. Refresh metadata for specified database #
REFRESH DATABASE METADATA schemaName FROM GOVERNANCE CENTER
Example
REFRESH DATABASE METADATA sharding_db FROM GOVERNANCE CENTER;
4. Import The Configuration In YAML Into The Database, And Only Support The Import Operation For Empty Databases #
IMPORT DATABASE CONFIGURATION
Example
IMPORT DATABASE CONFIGURATION FROM FILE "/xx x/config‑sharding.yaml";
5. Export The Data Source And Rule Configuration In The Database To YAML Format #
EXPORT DATABASE CONFIGURATION
Example
EXPORT DATABASE CONFIGURATION TO FILE "/xxx/config‑sharding.yaml";