DROP RESOURCE
Description
The DROP RESOURCE
syntax is used to drop resources from the current database
Syntax
DropResource ::=
'DROP' 'RESOURCE' ( 'IF' 'EXISTS' )? resourceName ( ',' resourceName )* ( 'IGNORE' 'SINGLE' 'TABLES' )?
resourceName ::=
identifier
Supplement
DROP RESOURCE
will only drop resources in Proxy, the real data source corresponding to the resource will not be dropped;- Unable to drop resources already used by rules.
Resources are still in used.
will be prompted when removing resources used by rules; - The resource need to be removed only contains
SINGLE TABLE RULE
, and when the user confirms that this restriction can be ignored, theIGNORE SINGLE TABLES
keyword can be added to remove the resource.
Example
- Drop a resource
DROP RESOURCE ds_0;
- Drop multiple resources
DROP RESOURCE ds_1, ds_2;
- Ignore single table rule remove resource
DROP RESOURCE ds_1 IGNORE SINGLE TABLES;
- Drop the resource if it exists
DROP RESOURCE IF EXISTS ds_2;
Reserved word
DROP
, RESOURCE
, IF
, EXISTS
, IGNORE
, SINGLE
, TABLES
Related links
当前内容版权归 ShardingSphere 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 ShardingSphere .