Skip to main content

Sequence

You can provide configuration to Snowflake Object Lifecycle Engine for the following operations with sequence:

  • Manage the lifecycle of new and existing sequences
  • Manage the grants of a sequence

Usage

note

We have introduced SOLE for Data Products as a new framework for SOLE to help you easily build an ecosystem of data products. The major difference is in how you define Snowflake objects in the configuration file. Rather than having a grouped collection of objects, SOLE for Data Products goes for modular, self-describing, and explicit object definition.
Learn more about SOLE for Data Products, currently available as a public preview.

We have also introduced Data products as an extra layer on top of the data product platform capabilities making managing data products easier than ever. Learn more about Data Products, currently available as a private preview.

databases:
<database-name>:
schemas:
<schema-name>:
sequences:
<sequence-name>:
<configuration-key>: <value>
grants:
<privilege>:
- <role-name>
- <role-name>

Supported parameters

The engine supports the parameters listed below.

Configuration KeyRequired/OptionalData Types and ValuesDescription
commentOptionalStringSpecifies a comment for the sequence
deletedOptionalBoolean: True enables deletion prevention, False does nothingSpecifies what objects are allowed to be deleted
incrementOptionalIntegerThe amount the sequence will increase by each time it is used
grantsOptionalMap: See Supported Sequence Grants to RolesList of Privileges and Roles to which privileges are granted on the current sequence
manage_modeOptionalString: all (default), none, grantsConfigures what properties to manage for the sequence.
See Changing Manage Mode before changing the value.
orderingOptionalString: ORDER (default)The ordering of the sequence, which can be ORDER or NOORDER. The default is ORDER.
Note: If a sequence is set to NOORDER, you cannot change it back to ORDER.

Supported sequence grants to roles

Following are the privileges you can grant to roles in the sequence definition:

  • USAGE
  • OWNERSHIP

Examples

databases:
DATABASE_1:
comment: "Database one"
schemas:
SCHEMA_1:
comment: "Schema one"
sequences:
SEQ_1:
grants:
USAGE:
- ACCOUNTADMIN
- ROLE_1
comment: "Sequence 1"
ordering: NOORDER