database_role
database_role attributes
database_role constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., database_role "name" ) | true |
dynamic_table
The dynamic block describes a dynamic table in a database schema.
dynamic_table "users" {
schema = schema.public
column "id" {
comment = "User ID"
}
target_lag = DOWNSTREAM
refresh_mode = INCREMENTAL, or FULL
as = "SELECT * FROM users"
...
}
dynamic_table attributes
dynamic_table blocks
dynamic_table.column
dynamic_table.column attributes
| Name | Required | Value |
|---|
comment | false | string |
type | false | Column type can be one of:
- Schema type
- Raw expression defined with
sql("expr")
|
dynamic_table.column blocks
dynamic_table.column.annotation
dynamic_table.column.annotation constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
dynamic_table.column.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
dynamic_table.column.tag attributes
| Name | Required | Value |
|---|
ref | true | Tag reference can be one of:
- Object reference to
tag
string
|
value | true | string |
dynamic_table.column.tag constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
dynamic_table.column constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., dynamic_table.column "name" ) | true |
dynamic_table.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
dynamic_table.tag attributes
| Name | Required | Value |
|---|
ref | true | Tag reference can be one of:
- Object reference to
tag
string
|
value | true | string |
dynamic_table.tag constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
dynamic_table constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., dynamic_table "name" ) | true |
Allow Qualifier (e.g., dynamic_table "schema" "name" ) | true |
external_table
The external_table block describes an external table in a database schema.
external_table "events" {
schema = schema.public
column "event_id" {
type = VARCHAR(255)
as {
expr = "value:c1::varchar"
}
}
location {
stage = stage.mystage
path = "data/events/"
}
}
external_table attributes
external_table blocks
external_table.column
external_table.column attributes
| Name | Required | Value |
|---|
as | false | string |
comment | false | string |
null | false | bool |
type | true | Column type can be one of:
- Schema type
- Raw expression defined with
sql("expr")
|
external_table.column blocks
external_table.column.annotation
external_table.column.annotation constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
external_table.column.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
external_table.column.tag attributes
| Name | Required | Value |
|---|
ref | true | Tag reference can be one of:
- Object reference to
tag
string
|
value | true | string |
external_table.column.tag constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
external_table.column constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., external_table.column "name" ) | true |
external_table.foreign_key
external_table.foreign_key attributes
external_table.foreign_key constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., external_table.foreign_key "name" ) | true |
external_table.location
external_table.location attributes
external_table.location constraints
| Constraint | Value |
|---|
| Required | true |
| Require Name | false |
external_table.primary_key
external_table.primary_key attributes
external_table.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
external_table.tag attributes
| Name | Required | Value |
|---|
ref | true | Tag reference can be one of:
- Object reference to
tag
string
|
value | true | string |
external_table.tag constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
external_table.unique
external_table.unique attributes
external_table.unique constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Mutually exclusive sets | [columns, on] |
| One of required sets | [columns, on] |
external_table constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., external_table "name" ) | true |
Allow Qualifier (e.g., external_table "schema" "name" ) | true |
external_volume
The external_volume block describes a Snowflake external volume for Iceberg tables.
external_volume "my_vol" {
allow_writes = true
comment = "My external volume"
storage_location "S3" "my-s3-location" {
storage_base_url = "s3://my-bucket/path/"
storage_aws_role_arn = "arn:aws:iam::123456789012:role/myrole"
encryption {
type = "AWS_SSE_KMS"
kms_key_id = "1234abcd-12ab-34cd-56ef-1234567890ab"
}
}
}
external_volume attributes
external_volume blocks
external_volume.storage_location.AZURE
external_volume.storage_location.AZURE attributes
external_volume.storage_location.AZURE constraints
| Constraint | Value |
|---|
| Required | false |
| Repeatable | true |
external_volume.storage_location.GCS
external_volume.storage_location.GCS attributes
external_volume.storage_location.GCS blocks
external_volume.storage_location.encryption
external_volume.storage_location.encryption attributes
external_volume.storage_location.GCS constraints
| Constraint | Value |
|---|
| Required | false |
| Repeatable | true |
external_volume.storage_location.S3
external_volume.storage_location.S3 attributes
external_volume.storage_location.S3 blocks
external_volume.storage_location.encryption
external_volume.storage_location.encryption attributes
external_volume.storage_location.S3 constraints
| Constraint | Value |
|---|
| Required | false |
| Repeatable | true |
external_volume.storage_location.S3COMPAT
external_volume.storage_location.S3COMPAT attributes
external_volume.storage_location.S3COMPAT constraints
| Constraint | Value |
|---|
| Required | false |
| Repeatable | true |
external_volume.storage_location.S3GOV
external_volume.storage_location.S3GOV attributes
external_volume.storage_location.S3GOV blocks
external_volume.storage_location.encryption
external_volume.storage_location.encryption attributes
external_volume.storage_location.S3GOV constraints
| Constraint | Value |
|---|
| Required | false |
| Repeatable | true |
external_volume constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., external_volume "name" ) | true |
The file_format block describes a named Snowflake file format in a database schema.
file_format "my_csv_format" {
schema = schema.public
comment = "My CSV file format"
type = CSV
options = {
BINARY_AS_TEXT = false
COMPRESSION = GZIP
FIELD_DELIMITER = "|"
SKIP_HEADER = 1
}
}
| Name | Required | Value |
|---|
false | string |
options | false | map |
schema | true | Object reference to schema |
type | true | enum (AVRO, CSV, JSON, ORC, PARQUET, XML)
|
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., file_format "name" ) | true |
Allow Qualifier (e.g., file_format "schema" "name" ) | true |
function
The function block describes a function in a database schema.
function "positive" {
schema = schema.public
lang = SQL
arg "v" {
type = integer
}
...
}
function attributes
function blocks
function.annotation
function.annotation constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
function.arg
function.arg attributes
| Name | Required | Value |
|---|
default | false | Argument default value can be one of:
number
string
bool
- Raw expression defined with
sql("expr")
|
type | true | Argument type can be one of:
- Schema type
- Raw expression defined with
sql("expr")
|
function.arg constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., function.arg "name" ) | true |
function.imports
function.imports attributes
function.imports constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
function.return_table
function.return_table blocks
function.return_table.column
function.return_table.column attributes
| Name | Required | Value |
|---|
type | true | Column type can be one of:
- Schema type
- Raw expression defined with
sql("expr")
|
function.return_table.column blocks
function.return_table.column.annotation
function.return_table.column.annotation constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
function.return_table.column constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., function.return_table.column "name" ) | true |
function.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
function.tag attributes
| Name | Required | Value |
|---|
ref | true | Tag reference can be one of:
- Object reference to
tag
string
|
value | true | string |
function.tag constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
function constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., function "name" ) | true |
Allow Qualifier (e.g., function "schema" "name" ) | true |
| Repeatable | true |
| Mutually exclusive sets | [return, return_table] |
hybrid_table
The hybrid block describes a hybrid table in a database schema.
hybrid_table "users" {
schema = schema.public
column "id" {
comment = "User ID"
type = VARCHAR(255)
}
primary_key {
columns = ["id"]
}
...
}
hybrid_table attributes
hybrid_table blocks
hybrid_table.column
hybrid_table.column attributes
| Name | Required | Value |
|---|
collate | false | string |
comment | false | string |
default | false | Column default value can be one of:
bool
string
number
- Raw expression defined with
sql("expr")
|
null | false | bool |
type | true | Column type can be one of:
- Schema type
- Raw expression defined with
sql("expr")
|
hybrid_table.column blocks
hybrid_table.column.annotation
hybrid_table.column.annotation constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
hybrid_table.column.identity
hybrid_table.column.identity attributes
hybrid_table.column.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
hybrid_table.column.tag attributes
| Name | Required | Value |
|---|
ref | true | Tag reference can be one of:
- Object reference to
tag
string
|
value | true | string |
hybrid_table.column.tag constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
hybrid_table.column constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., hybrid_table.column "name" ) | true |
hybrid_table.foreign_key
hybrid_table.foreign_key attributes
hybrid_table.foreign_key constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., hybrid_table.foreign_key "name" ) | true |
hybrid_table.primary_key
hybrid_table.primary_key attributes
hybrid_table.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
hybrid_table.tag attributes
| Name | Required | Value |
|---|
ref | true | Tag reference can be one of:
- Object reference to
tag
string
|
value | true | string |
hybrid_table.tag constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
hybrid_table.unique
hybrid_table.unique attributes
hybrid_table.unique constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Mutually exclusive sets | [columns, on] |
| One of required sets | [columns, on] |
hybrid_table constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., hybrid_table "name" ) | true |
Allow Qualifier (e.g., hybrid_table "schema" "name" ) | true |
iceberg_table
The iceberg_table block describes an Iceberg table in a database schema.
iceberg_table "events" {
schema = schema.public
external_volume = "my_ext_vol"
catalog = "SNOWFLAKE"
base_location = "iceberg/tables/"
column "id" {
type = NUMBER(38,0)
}
}
iceberg_table attributes
iceberg_table blocks
iceberg_table.column
iceberg_table.column attributes
| Name | Required | Value |
|---|
comment | false | string |
default | false | Column default value can be one of:
bool
string
number
- Raw expression defined with
sql("expr")
|
null | false | bool |
type | true | Column type can be one of:
- Schema type
- Raw expression defined with
sql("expr")
|
iceberg_table.column blocks
iceberg_table.column.annotation
iceberg_table.column.annotation constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
iceberg_table.column.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
iceberg_table.column.tag attributes
| Name | Required | Value |
|---|
ref | true | Tag reference can be one of:
- Object reference to
tag
string
|
value | true | string |
iceberg_table.column.tag constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
iceberg_table.column constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., iceberg_table.column "name" ) | true |
iceberg_table.foreign_key
iceberg_table.foreign_key attributes
iceberg_table.foreign_key constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., iceberg_table.foreign_key "name" ) | true |
iceberg_table.primary_key
iceberg_table.primary_key attributes
iceberg_table.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
iceberg_table.tag attributes
| Name | Required | Value |
|---|
ref | true | Tag reference can be one of:
- Object reference to
tag
string
|
value | true | string |
iceberg_table.tag constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
iceberg_table.unique
iceberg_table.unique attributes
iceberg_table.unique constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Mutually exclusive sets | [columns, on] |
| One of required sets | [columns, on] |
iceberg_table constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., iceberg_table "name" ) | true |
Allow Qualifier (e.g., iceberg_table "schema" "name" ) | true |
| Mutually exclusive sets | [partition_by, cluster_by] |
permission
permission attributes
| Name | Required | Value |
|---|
for | true | Permission target resource can be one of:
enum (DATABASE)
- Object reference to
schema
- Object reference to
table
- Object reference to
view
|
grantable | false | bool |
privileges | true | List of strings or/and enums (USAGE, MONITOR, MODIFY, CREATE_SCHEMA, CREATE_TABLE, SELECT, INSERT, UPDATE, DELETE, REFERENCES, ALL) |
to | true | Permission grantee can be one of:
- Object reference to
role
- Object reference to
database_role
|
permission constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
pipe
The pipe block describes a Snowflake pipe for Snowpipe data loading.
pipe "mypipe" {
schema = schema.public
as = "COPY INTO mytable FROM @mystage FILE_FORMAT = (TYPE = 'JSON')"
auto_ingest = true
comment = "My data loading pipe"
}
pipe attributes
pipe blocks
pipe.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
pipe.tag attributes
| Name | Required | Value |
|---|
ref | true | Tag reference can be one of:
- Object reference to
tag
string
|
value | true | string |
pipe.tag constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
pipe constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., pipe "name" ) | true |
Allow Qualifier (e.g., pipe "schema" "name" ) | true |
procedure
The procedure block describes a procedure in a database schema.
procedure "proc" {
schema = schema.public
lang = SQL
arg "a" {
type = integer
}
...
}
procedure attributes
procedure blocks
procedure.annotation
procedure.annotation constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
procedure.arg
procedure.arg attributes
| Name | Required | Value |
|---|
default | false | Argument default value can be one of:
number
string
bool
- Raw expression defined with
sql("expr")
|
mode | false | enum (IN, OUT)
|
type | true | Argument type can be one of:
- Schema type
- Raw expression defined with
sql("expr")
|
procedure.arg constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., procedure.arg "name" ) | true |
procedure.imports
procedure.imports attributes
procedure.imports constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
procedure.return
procedure.return attributes
| Name | Required | Value |
|---|
null | false | bool |
type | true | Return type can be one of:
- Schema type
- Raw expression defined with
sql("expr")
|
procedure.return_table
procedure.return_table blocks
procedure.return_table.column
procedure.return_table.column attributes
| Name | Required | Value |
|---|
type | true | Column type can be one of:
- Schema type
- Raw expression defined with
sql("expr")
|
procedure.return_table.column blocks
procedure.return_table.column.annotation
procedure.return_table.column.annotation constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
procedure.return_table.column constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., procedure.return_table.column "name" ) | true |
procedure.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
procedure.tag attributes
| Name | Required | Value |
|---|
ref | true | Tag reference can be one of:
- Object reference to
tag
string
|
value | true | string |
procedure.tag constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
procedure constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., procedure "name" ) | true |
Allow Qualifier (e.g., procedure "schema" "name" ) | true |
| Repeatable | true |
| Mutually exclusive sets | [return, return_table] |
resource_monitor
The resource_monitor block describes a Snowflake resource monitor.
resource_monitor "my_rm" {
credit_quota = 1000
frequency = MONTHLY
notify_users = ["alice"]
trigger {
threshold = 100
action = SUSPEND
}
}
resource_monitor attributes
resource_monitor blocks
resource_monitor.trigger
resource_monitor.trigger attributes
| Name | Required | Value |
|---|
action | true | enum (SUSPEND, SUSPEND_IMMEDIATE, NOTIFY)
|
threshold | true | int |
resource_monitor.trigger blocks
resource_monitor.trigger.annotation
resource_monitor.trigger.annotation constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
resource_monitor.trigger constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
resource_monitor constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., resource_monitor "name" ) | true |
role
role attributes
| Name | Required | Value |
|---|
false | string |
member_of | false | List of values, where each can be one of:
- Object reference to
role
- Object reference to
database_role
|
role constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., role "name" ) | true |
schema
The schema block describes a database schema.
schema attributes
schema blocks
schema.annotation
schema.annotation constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
schema.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
schema.tag attributes
| Name | Required | Value |
|---|
ref | true | Tag reference can be one of:
- Object reference to
tag
string
|
value | true | string |
schema.tag constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
schema constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., schema "name" ) | true |
sequence
The sequence block describes a Snowflake sequence in a database schema.
sequence "myseq" {
schema = schema.public
start = 1
increment = 1
order = true
comment = "My sequence"
}
sequence attributes
sequence blocks
sequence.annotation
sequence.annotation constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
sequence constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., sequence "name" ) | true |
Allow Qualifier (e.g., sequence "schema" "name" ) | true |
stage
The stage block describes a Snowflake stage in a database schema.
stage "mystage" {
schema = schema.public
url = "s3://mybucket/data/"
storage_integration = "my_integration"
directory_enabled = true
comment = "This is my stage"
}
stage attributes
stage blocks
stage.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
stage.tag attributes
| Name | Required | Value |
|---|
ref | true | Tag reference can be one of:
- Object reference to
tag
string
|
value | true | string |
stage.tag constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
stage constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., stage "name" ) | true |
Allow Qualifier (e.g., stage "schema" "name" ) | true |
table
The table block describes a table in a database schema.
table "users" {
schema = schema.public
column "id" {
type = int
}
...
}
table attributes
table blocks
table.annotation
table.annotation constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
table.column
table.column attributes
| Name | Required | Value |
|---|
collate | false | string |
comment | false | string |
default | false | Column default value can be one of:
bool
string
number
- Raw expression defined with
sql("expr")
|
null | false | bool |
type | true | Column type can be one of:
- Schema type
- Raw expression defined with
sql("expr")
|
table.column blocks
table.column.annotation
table.column.annotation constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
table.column.identity
table.column.identity attributes
table.column.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
table.column.tag attributes
| Name | Required | Value |
|---|
ref | true | Tag reference can be one of:
- Object reference to
tag
string
|
value | true | string |
table.column.tag constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
table.column constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., table.column "name" ) | true |
table.foreign_key
table.foreign_key attributes
| Name | Required | Value |
|---|
columns | true | Foreign key columns can be one of:
- List of object reference to
column
- List of object reference to
table.column
|
false | string |
ref_columns | true | Foreign key reference columns can be one of:
- List of object reference to
column
- List of object reference to
table.column
|
table.foreign_key constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., table.foreign_key "name" ) | true |
table.primary_key
table.primary_key attributes
| Name | Required | Value |
|---|
columns | true | Index columns can be one of:
- List of object reference to
column
- List of object reference to
table.column
|
false | string |
table.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
table.tag attributes
| Name | Required | Value |
|---|
ref | true | Tag reference can be one of:
- Object reference to
tag
string
|
value | true | string |
table.tag constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
table.unique
table.unique attributes
| Name | Required | Value |
|---|
columns | true | Index columns can be one of:
- List of object reference to
column
- List of object reference to
table.column
|
false | string |
table.unique constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Mutually exclusive sets | [columns, on] |
| One of required sets | [columns, on] |
table constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., table "name" ) | true |
Allow Qualifier (e.g., table "schema" "name" ) | true |
tag
The tag block describes a Snowflake tag in a database schema.
tag "public" "cost_center" {
schema = schema.public
allowed_values = ["finance", "engineering", "sales"]
propagate = ON_DEPENDENCY
on_conflict = ALLOWED_VALUES_SEQUENCE
comment = "cost center tag"
}
tag attributes
| Name | Required | Value |
|---|
allowed_values | false | List of strings |
false | string |
on_conflict | false | Conflict resolution strategy can be one of:
enum (ALLOWED_VALUES_SEQUENCE)
string
|
propagate | false | enum (ON_DEPENDENCY, ON_DATA_MOVEMENT, ON_DEPENDENCY_AND_DATA_MOVEMENT)
|
schema | true | Object reference to schema |
tag constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., tag "name" ) | true |
Allow Qualifier (e.g., tag "schema" "name" ) | true |
task
The task block describes a Snowflake task in a database schema.
task "my_task" {
schema = schema.public
schedule = "5 MINUTE"
warehouse = "my_wh"
as = "INSERT INTO t1 SELECT * FROM t2"
comment = "This is my task"
}
task attributes
task blocks
task.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
task.tag attributes
| Name | Required | Value |
|---|
ref | true | Tag reference can be one of:
- Object reference to
tag
string
|
value | true | string |
task.tag constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
task constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., task "name" ) | true |
Allow Qualifier (e.g., task "schema" "name" ) | true |
user
user attributes
| Name | Required | Value |
|---|
false | string |
member_of | false | List of object reference to role |
user constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., user "name" ) | true |
view
The view block describes a view in a database schema.
view "clean_users" {
schema = schema.public
column "id" {
type = int
}
...
}
view attributes
view blocks
view.annotation
view.annotation constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
view.column
view.column attributes
| Name | Required | Value |
|---|
comment | false | string |
default | false | Column default value can be one of:
bool
string
number
- Raw expression defined with
sql("expr")
|
null | false | bool |
type | false | Column type can be one of:
- Schema type
- Raw expression defined with
sql("expr")
|
view.column blocks
view.column.annotation
view.column.annotation constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
view.column.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
view.column.tag attributes
| Name | Required | Value |
|---|
ref | true | Tag reference can be one of:
- Object reference to
tag
string
|
value | true | string |
view.column.tag constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
view.column constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., view.column "name" ) | true |
view.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
view.tag attributes
| Name | Required | Value |
|---|
ref | true | Tag reference can be one of:
- Object reference to
tag
string
|
value | true | string |
view.tag constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
view constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., view "name" ) | true |
Allow Qualifier (e.g., view "schema" "name" ) | true |
warehouse
The warehouse block describes a Snowflake virtual warehouse.
warehouse "my_wh" {
size = "X-Small"
type = STANDARD
auto_suspend = 600
auto_resume = true
comment = "My warehouse"
}
warehouse attributes
| Name | Required | Value |
|---|
auto_resume | false | bool |
auto_suspend | false | int |
false | string |
generation | false | enum (1, 2)
|
resource_constraint | false | enum (STANDARD_GEN_1, STANDARD_GEN_2, MEMORY_1X, MEMORY_1X_x86, MEMORY_16X, MEMORY_16X_x86, MEMORY_64X, MEMORY_64X_x86)
|
resource_monitor | false | Resource monitor name or reference can be one of:
- Object reference to
resource_monitor
string
|
size | false | enum (XSMALL, SMALL, MEDIUM, LARGE, XLARGE, XXLARGE, XXXLARGE, X4LARGE, X5LARGE, X6LARGE)
|
type | false | enum (STANDARD, SNOWPARK-OPTIMIZED, ADAPTIVE)
|
warehouse blocks
warehouse.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
warehouse.tag attributes
| Name | Required | Value |
|---|
ref | true | Tag reference can be one of:
- Object reference to
tag
string
|
value | true | string |
warehouse.tag constraints
| Constraint | Value |
|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
warehouse constraints
| Constraint | Value |
|---|
| Required | false |
Require Name (e.g., warehouse "name" ) | true |