Retro Eye care Haitian Deep Dark Default

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 ::=
  identifier

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