Logo
Table Reference

Table Reference #

SyntaxDescriptionType
CREATE SHARDING TABLE REFERENCE RULE tableReferenceRuleDefinition [, tableReferenceRuleDefinition] …Create sharding table referenceRDL
ALTER SHARDING TABLE REFERENCE RULE tableReferenceRuleDefinition [, tableReferenceRuleDefinition] …Modify sharding table referenceRDL
ALTER SHARDING BINDING TABLE RULE TOOnly used by SphereEx-Console, not specified in the documentRDL
DROP SHARDING TABLE REFERENCE RULE tableReferenceRuleDefinition [, tableReferenceRuleDefinition] …Delete table referenceRDL
SHOW SHARDING TABLE REFERENCE RULES [FROM databaseName]View table referenceRQL
SHOW SHARDING TABLE REFERENCE RULE ruleNameImplement in version 1.3.0RQL

1. Create Sharding Table Reference #

CREATE SHARDING TABLE REFERENCE RULE tableReferenceRuleDefinition [, tableReferenceRuleDefinition] ...
tableReferenceRuleDefinition:
    (tableName [, tableName] ... )

Example

CREATE SHARDING TABLE REFERENCE RULE (t_order,t_order_item),(t_1,t_2);

2. Modify Sharding Table Reference #

ALTER SHARDING TABLE REFERENCE RULE tableReferenceRuleDefinition [, tableReferenceRuleDefinition] ...

tableReferenceRuleDefinition:
    (tableName [, tableName] ... )

Example

ALTER SHARDING TABLE REFERENCE RULE (t_order,t_order_item);

3. Delete Sharding Table Reference #

DROP SHARDING TABLE REFERENCE RULE tableReferenceRuleDefinition [, tableReferenceRuleDefinition] ...

tableReferenceRuleDefinition:
    (tableName [, tableName] ... )

Example

Delete all table reference

DROP SHARDING TABLE REFERENCE RULE;

Delete specified table reference

DROP SHARDING TABLE REFERENCE RULE (t_order,t_order_item);

4. View Table Reference #

SHOW SHARDING TABLE REFERENCE RULES;

Parameter Description

None

Example

mysql> SHOW SHARDING TABLE REFERENCE RULES;
+--------------------------+
| sharding_table_reference |
+--------------------------+
| t_order,t_order_item     |
| t1,t2                    |
+--------------------------+
2 rows in set (0.00 sec)

Output Description

ColumnDescription
sharding_table_referenceTable reference