CREATE SHADOW ALGORITHM
Description
The CREATE SHADOW ALGORITHM
syntax is used to create a shadow algorithm.
Syntax
CreateShadowAlgorithm ::=
'CREATE' 'SHADOW' 'ALGORITHM' shadowAlgorithm ( ',' shadowAlgorithm )*
shadowAlgorithm ::=
'(' ( algorithmName ',' )? 'TYPE' '(' 'NAME' '=' shadowAlgorithmType ',' 'PROPERTIES' '(' ( 'key' '=' 'value' ( ',' 'key' '=' 'value' )* ) ')' ')'
algorithmName ::=
identifier
shadowAlgorithmType ::=
string
Supplement
shadowAlgorithm
can act on multipleshadowTableRule
at the same time;- If
algorithmName
is not specified, it will be automatically generated according toruleName
,tableName
andshadowAlgorithmType
; shadowAlgorithmType
currently supportsVALUE_MATCH
,REGEX_MATCH
andSIMPLE_HINT
.
Example
Create a shadow algorithm
CREATE SHADOW ALGORITHM
(simple_hint_algorithm, TYPE(NAME="SIMPLE_HINT", PROPERTIES("shadow"="true", "foo"="bar"))),
(user_id_match_algorithm, TYPE(NAME="REGEX_MATCH",PROPERTIES("operation"="insert", "column"="user_id", "regex"='[1]'))
);
Reserved word
CREATE
, SHADOW
, ALGORITHM
, TYPE
, NAME
, PROPERTIES
Related links
当前内容版权归 ShardingSphere 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 ShardingSphere .