Redshift Schema
datashare
The datashare block describes a datashare created in this database, and the consumers granted access to it. A function is shared by name: Redshift does not report which of its overloads a datashare holds, so every overload is added to and removed from the share together.
datashare "sales_share" {
public_accessible = false
schema {
for = schema.sales
objects = [table.orders, view.summary]
}
schema {
for = schema.logs
include_new = true
}
schema {
for = schema.events
include_new_except = [table.audit]
}
namespaces = ["00000000-0000-0000-0000-000000000000"]
accounts = ["000000000000"]
}
datashare attributes
| Name and description | Required | Value |
|---|---|---|
AWS account IDs of the consumers granted usage on the datashare. Used for a consumer in another account, which then grants its own namespaces. | false | List of strings |
Namespace identifiers of the consumers granted usage on the datashare. Used for a consumer in the same AWS account. | false | List of strings |
public_accessible | false | bool |
datashare blocks
datashare.schema
A schema shared by the datashare, and the objects shared from it.
datashare.schema attributes
| Name and description | Required | Value |
|---|---|---|
for | true | Schema reference or name can be one of:
|
Share every object of the schema, including the ones created later. Redshift shares only the objects created after this is set, so the ones that already exist are shared by Atlas. | false | bool |
Share every object of the schema except these. Implies | false | List of values, where each can be one of:
|
objects | false | List of values, where each can be one of:
|
datashare.schema blocks
datashare.schema.annotation
datashare.schema.annotation constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
datashare.schema constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
| Mutually exclusive sets | [objects, include_new, include_new_except] |
datashare constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., datashare "name" ) | true |
| One of required sets | [namespaces, accounts] |
function
The function block describes a function in a database schema.
function "positive" {
schema = schema.public
lang = SQL
arg "v" {
type = integer
}
...
}
function attributes
| Name | Required | Value |
|---|---|---|
as | true | string |
depends_on | false | List of object references |
lang | true | Function language can be one of:
|
return | false | Function return type can be one of:
|
schema | true | Object reference to |
volatility | false |
|
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 |
|---|---|---|
type | true | Function argument type can be one of:
|
function.arg 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 |
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.annotation
materialized.annotation constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
materialized.column
materialized.column attributes
| Name | Required | Value |
|---|---|---|
comment | false | string |
null | false | bool |
type | true | Column type can be one of:
|