Redshift Schema
materialized
The materialized
block describes a materialized view in a database schema.
materialized "name" {
schema = schema.public
column "total" {
null = true
type = numeric
}
...
}
materialized
attributes
Name | Required | Value |
---|---|---|
as | true | string |
auto_refresh | false | bool |
comment | false | string |
depends_on | false | List of object references |
schema | true | Object reference to |
materialized
blocks
materialized.column
materialized.column
attributes
Name | Required | Value |
---|---|---|
comment | false | string |
null | false | bool |
type | true | Column type can be one of:
|
materialized.column
constraints
Constraint | Value |
---|---|
Required | false |
Require Name (e.g., materialized.column "name" ) | true |
materialized.distribution
materialized.distribution
attributes
Name | Required | Value |
---|---|---|
column | false | Object reference |
style | false |
|
materialized.sort
materialized.sort
attributes
Name | Required | Value |
---|---|---|
columns | false | List of object reference to |
style | false |
|
materialized
constraints
Constraint | Value |
---|---|
Required | false |
Require Name (e.g., materialized "name" ) | true |
Allow Qualifier (e.g., materialized "schema" "name" ) | true |
schema
The schema
block describes a database schema.
schema "public" {
...
}
schema
attributes
Name | Required | Value |
---|---|---|
comment | false | string |
name | false | string |
schema
constraints
Constraint | Value |
---|---|
Required | false |
Require Name (e.g., 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
Name | Required | Value |
---|---|---|
comment | false | string |
schema | true | Object reference to |
table
blocks
table.column
table.column
attributes
Name | Required | Value |
---|---|---|
comment | false | string |
default | false | Column default value can be one of:
|
encode | false |
|
null | false | bool |
type | true | Column type can be one of:
|
table.column
constraints
Constraint | Value |
---|---|
Required | false |
Require Name (e.g., table.column "name" ) | true |
table.distribution
table.distribution
attributes
Name | Required | Value |
---|---|---|
column | false | Object reference |
style | false |
|
table.sort
table.sort
attributes
Name | Required | Value |
---|---|---|
columns | false | List of object reference to |
style | false |
|
table
constraints
Constraint | Value |
---|---|
Required | false |
Require Name (e.g., table "name" ) | true |
Allow Qualifier (e.g., table "schema" "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
Name | Required | Value |
---|---|---|
as | true | string |
comment | false | string |
depends_on | false | List of object references |
schema | true | Object reference to |
view
blocks
view.column
view.column
attributes
Name | Required | Value |
---|---|---|
comment | false | string |
null | false | bool |
type | true | Column type can be one of:
|
view.column
constraints
Constraint | Value |
---|---|
Required | false |
Require Name (e.g., view.column "name" ) | true |