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
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 private 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.
- Default Configuration
- Data Products Configuration
databases:
<database-name>:
schemas:
<schema-name>:
sequences:
<sequence-name>:
<configuration-key>: <value>
grants:
<privilege>:
- <role-name>
- <role-name>
- sequence:
name: <sequence-name>
<configuration-key>: <value>
database: rel(database.<database-name>)
schema: rel(schema.<schema-name>)
grants:
<privilege>:
- rel(role.<role-name>)
- rel(role.<role-name>)
Supported parameters
The engine supports the parameters listed below.
Configuration Key | Required/Optional | Data Types and Values | Description |
---|---|---|---|
comment | Optional | String | Specifies a comment for the sequence |
deleted | Optional | Boolean: True enables deletion prevention, False does nothing | Specifies what objects are allowed to be deleted |
increment | Optional | Integer | The amount the sequence will increase by each time it is used |
grants | Optional | Map: See Supported Sequence Grants to Roles | List of Privileges and Roles to which privileges are granted on the current sequence |
manage_mode | Optional | String: all (default), none , grants | Configures what properties to manage for the sequence. See Changing Manage Mode before changing the value. |
Supported sequence grants to roles
Following are the privileges you can grant to roles in the sequence definition:
- USAGE
- OWNERSHIP
Examples
- Default Configuration
- Data Products Configuration
databases:
DATABASE_1:
comment: "Database one"
schemas:
SCHEMA_1:
comment: "Schema one"
sequences:
SEQ_1:
grants:
USAGE:
- ACCOUNTADMIN
- ROLE_1
comment: "Sequence 1"
- sequence:
name: SEQ_1
database: rel(database.DATABASE_1)
schema: rel(schema.SCHEMA_1)
grants:
USAGE:
- ACCOUNTADMIN
- rel(role.ROLE_1)
comment: "Sequence 1"