CREATE SHARDING KEY GENERATOR
Description
The CREATE SHARDING KEY GENERATOR
syntax is used to add a distributed primary key generator for the currently selected logic database
Syntax
CreateShardingAlgorithm ::=
'CREATE' 'SHARDING' 'KEY' 'GENERATOR' keyGeneratorName '(' algorithmDefinition ')'
algorithmDefinition ::=
'TYPE' '(' 'NAME' '=' algorithmType ( ',' 'PROPERTIES' '(' propertyDefinition ')' )?')'
propertyDefinition ::=
( key '=' value ) ( ',' key '=' value )*
keyGeneratorName ::=
identifier
algorithmType ::=
string
Supplement
algorithmType
is the key generate algorithm type. For detailed key generate algorithm type information, please refer to KEY GENERATE ALGORITHM.
Example
Create a distributed primary key generator
CREATE SHARDING KEY GENERATOR snowflake_key_generator (
TYPE(NAME="SNOWFLAKE", PROPERTIES("max-vibration-offset"="3"))
);
Reserved word
CREATE
, SHARDING
, KEY
, GENERATOR
, TYPE
, NAME
, PROPERTIES
Related links
当前内容版权归 ShardingSphere 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 ShardingSphere .