diff --git a/schemas/1.5/dbt_project-1.5.json b/schemas/1.5/dbt_project-1.5.json index 1070aac..4e26f7a 100644 --- a/schemas/1.5/dbt_project-1.5.json +++ b/schemas/1.5/dbt_project-1.5.json @@ -301,6 +301,9 @@ "+grant_access_to": { "$ref": "#/$defs/grant_access_to" }, + "+grants": { + "$ref": "#/$defs/grants" + }, "+group": { "$ref": "#/$defs/group" }, @@ -377,6 +380,9 @@ "grant_access_to": { "$ref": "#/$defs/grant_access_to" }, + "grants": { + "$ref": "#/$defs/grants" + }, "group": { "$ref": "#/$defs/group" }, @@ -466,6 +472,9 @@ "+enabled": { "$ref": "#/$defs/boolean_or_jinja_string" }, + "+grants": { + "$ref": "#/$defs/grants" + }, "+group": { "$ref": "#/$defs/group" }, @@ -499,6 +508,9 @@ "enabled": { "$ref": "#/$defs/boolean_or_jinja_string" }, + "grants": { + "$ref": "#/$defs/grants" + }, "group": { "$ref": "#/$defs/group" }, @@ -827,6 +839,16 @@ "additionalProperties": false } }, + "grants": { + "type": "object", + "description": "grant config. each key is a database permission and the value is the grantee of that permission", + "patternProperties": { + ".*": { + "$ref": "#/$defs/string_or_array_of_strings" + } + }, + "additionalProperties": false + }, "group": { "type": "string" }, @@ -871,9 +893,6 @@ "alias": { "type": "string" }, - "grants": { - "type": "object" - }, "strategy": { "type": "string" }, diff --git a/schemas/1.5/dbt_yml_files-1.5.json b/schemas/1.5/dbt_yml_files-1.5.json index 6e18d77..6cd15d7 100644 --- a/schemas/1.5/dbt_yml_files-1.5.json +++ b/schemas/1.5/dbt_yml_files-1.5.json @@ -392,6 +392,9 @@ "enabled": { "$ref": "#/$defs/boolean_or_jinja_string" }, + "grants": { + "$ref": "#/$defs/grants" + }, "quote_columns": { "$ref": "#/$defs/boolean_or_jinja_string" }, @@ -447,7 +450,7 @@ "$ref": "#/$defs/boolean_or_jinja_string" }, "grants": { - "type": "object" + "$ref": "#/$defs/grants" }, "persist_docs": { "$ref": "#/$defs/persist_docs_config" @@ -792,6 +795,16 @@ }, "additionalProperties": false }, + "grants": { + "type": "object", + "description": "grant config. each key is a database permission and the value is the grantee of that permission", + "patternProperties": { + ".*": { + "$ref": "#/$defs/string_or_array_of_strings" + } + }, + "additionalProperties": false + }, "group": { "type": "string" }, @@ -842,6 +855,9 @@ "additionalProperties": false } }, + "grants": { + "$ref": "#/$defs/grants" + }, "hours_to_expiration": { "type": "number", "description": "Configuration specific to BigQuery adapter used to set an expiration delay (in hours) to a table." diff --git a/schemas/1.6/dbt_project-1.6.json b/schemas/1.6/dbt_project-1.6.json index 232aa1e..3207606 100644 --- a/schemas/1.6/dbt_project-1.6.json +++ b/schemas/1.6/dbt_project-1.6.json @@ -257,6 +257,9 @@ "+enabled": { "$ref": "#/$defs/boolean_or_jinja_string" }, + "+grants": { + "$ref": "#/$defs/grants" + }, "+file_format": { "$ref": "#/$defs/file_format" }, @@ -333,6 +336,9 @@ "enabled": { "$ref": "#/$defs/boolean_or_jinja_string" }, + "grants": { + "$ref": "#/$defs/grants" + }, "file_format": { "$ref": "#/$defs/file_format" }, @@ -428,6 +434,9 @@ "+enabled": { "$ref": "#/$defs/boolean_or_jinja_string" }, + "+grants": { + "$ref": "#/$defs/grants" + }, "+group": { "$ref": "#/$defs/group" }, @@ -461,6 +470,9 @@ "enabled": { "$ref": "#/$defs/boolean_or_jinja_string" }, + "grants": { + "$ref": "#/$defs/grants" + }, "group": { "$ref": "#/$defs/group" }, @@ -789,6 +801,16 @@ "additionalProperties": false } }, + "grants": { + "type": "object", + "description": "grant config. each key is a database permission and the value is the grantee of that permission", + "patternProperties": { + ".*": { + "$ref": "#/$defs/string_or_array_of_strings" + } + }, + "additionalProperties": false + }, "group": { "type": "string" }, @@ -833,9 +855,6 @@ "alias": { "type": "string" }, - "grants": { - "type": "object" - }, "strategy": { "type": "string" }, diff --git a/schemas/1.6/dbt_yml_files-1.6.json b/schemas/1.6/dbt_yml_files-1.6.json index f728f63..34c360a 100644 --- a/schemas/1.6/dbt_yml_files-1.6.json +++ b/schemas/1.6/dbt_yml_files-1.6.json @@ -325,6 +325,9 @@ "enabled": { "$ref": "#/$defs/boolean_or_jinja_string" }, + "grants": { + "$ref": "#/$defs/grants" + }, "quote_columns": { "$ref": "#/$defs/boolean_or_jinja_string" }, @@ -431,7 +434,7 @@ "$ref": "#/$defs/boolean_or_jinja_string" }, "grants": { - "type": "object" + "$ref": "#/$defs/grants" }, "persist_docs": { "$ref": "#/$defs/persist_docs_config" @@ -883,6 +886,16 @@ }, "additionalProperties": false }, + "grants": { + "type": "object", + "description": "grant config. each key is a database permission and the value is the grantee of that permission", + "patternProperties": { + ".*": { + "$ref": "#/$defs/string_or_array_of_strings" + } + }, + "additionalProperties": false + }, "group": { "type": "string" }, @@ -1069,6 +1082,9 @@ "additionalProperties": false } }, + "grants": { + "$ref": "#/$defs/grants" + }, "hours_to_expiration": { "type": "number", "description": "Configuration specific to BigQuery adapter used to set an expiration delay (in hours) to a table." diff --git a/schemas/dbt_project.json b/schemas/dbt_project.json index e94c8d7..d626c21 100644 --- a/schemas/dbt_project.json +++ b/schemas/dbt_project.json @@ -286,6 +286,9 @@ "+grant_access_to": { "$ref": "#/$defs/grant_access_to" }, + "+grants": { + "$ref": "#/$defs/grants" + }, "+hours_to_expiration": { "$ref": "#/$defs/hours_to_expiration" }, @@ -359,6 +362,9 @@ "grant_access_to": { "$ref": "#/$defs/grant_access_to" }, + "grants": { + "$ref": "#/$defs/grants" + }, "hours_to_expiration": { "$ref": "#/$defs/hours_to_expiration" }, @@ -445,6 +451,9 @@ "+enabled": { "$ref": "#/$defs/boolean_or_jinja_string" }, + "+grants": { + "$ref": "#/$defs/grants" + }, "+meta": { "$ref": "#/$defs/meta" }, @@ -475,6 +484,9 @@ "enabled": { "$ref": "#/$defs/boolean_or_jinja_string" }, + "grants": { + "$ref": "#/$defs/grants" + }, "meta": { "$ref": "#/$defs/meta" }, @@ -788,6 +800,16 @@ "additionalProperties": false } }, + "grants": { + "type": "object", + "description": "grant config. each key is a database permission and the value is the grantee of that permission", + "patternProperties": { + ".*": { + "$ref": "#/$defs/string_or_array_of_strings" + } + }, + "additionalProperties": false + }, "hours_to_expiration": { "type": "number", "description": "Configuration specific to BigQuery adapter used to set an expiration delay (in hours) to a table." @@ -829,9 +851,6 @@ "alias": { "type": "string" }, - "grants": { - "type": "object" - }, "strategy": { "type": "string" }, diff --git a/schemas/dbt_yml_files.json b/schemas/dbt_yml_files.json index 0dddc06..06b1e52 100644 --- a/schemas/dbt_yml_files.json +++ b/schemas/dbt_yml_files.json @@ -1,1066 +1,1079 @@ { - "title": "dbt_yml_files", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "properties": { - "version": { - "type": "number", - "const": 2 - }, - "analyses": { - "type": "array", - "items": { - "type": "object", - "required": ["name"], - "properties": { - "name": { - "type": "string" - }, - "columns": { - "type": "array", - "items": { - "type": "object", - "required": ["name"], - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "data_type": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "config": { + "title": "dbt_yml_files", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "version": { + "type": "number", + "const": 2 + }, + "analyses": { + "type": "array", + "items": { + "type": "object", + "required": ["name"], + "properties": { + "name": { + "type": "string" + }, + "columns": { + "type": "array", + "items": { "type": "object", + "required": ["name"], "properties": { - "tags": { - "$ref": "#/$defs/string_or_array_of_strings" + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "data_type": { + "type": "string" } }, "additionalProperties": false - }, - "description": { - "type": "string" - }, - "docs": { - "$ref": "#/$defs/docs_config" } + }, + "config": { + "type": "object", + "properties": { + "tags": { + "$ref": "#/$defs/string_or_array_of_strings" + } + }, + "additionalProperties": false + }, + "description": { + "type": "string" + }, + "docs": { + "$ref": "#/$defs/docs_config" } } - }, - "exposures": { - "type": "array", - "items": { - "type": "object", - "required": ["depends_on", "name", "owner", "type"], - "$comment": "NB: depends_on is not strictly required, but is _expected_ according to the documentation", - "properties": { - "name": { + } + }, + "exposures": { + "type": "array", + "items": { + "type": "object", + "required": ["depends_on", "name", "owner", "type"], + "$comment": "NB: depends_on is not strictly required, but is _expected_ according to the documentation", + "properties": { + "name": { + "type": "string" + }, + "label": { + "type": "string", + "$comment": "Added in dbt Core v1.3" + }, + "type": { + "type": "string", + "enum": ["dashboard", "notebook", "analysis", "ml", "application"] + }, + "depends_on": { + "type": "array", + "items": { "type": "string" - }, - "label": { - "type": "string", - "$comment": "Added in dbt Core v1.3" - }, - "type": { - "type": "string", - "enum": ["dashboard", "notebook", "analysis", "ml", "application"] - }, - "depends_on": { - "type": "array", - "items": { + } + }, + "description": { + "type": "string" + }, + "maturity": { + "type": "string", + "enum": ["high", "medium", "low"] + }, + "meta": { + "type": "object" + }, + "owner": { + "type": "object", + "required": ["email"], + "properties": { + "name": { + "type": "string" + }, + "email": { "type": "string" } }, - "description": { - "type": "string" - }, - "maturity": { - "type": "string", - "enum": ["high", "medium", "low"] - }, - "meta": { - "type": "object" + "additionalProperties": false + }, + "tags": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "url": { + "type": "string" + } + } + } + }, + "groups": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "owner"], + "properties": { + "name": { + "type": "string" + }, + "owner": { + "type": "object", + "minProperties": 1, + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": "string" + } }, - "owner": { + "additionalProperties": true + } + }, + "additionalProperties": false + } + }, + "macros": { + "type": "array", + "items": { + "type": "object", + "required": ["name"], + "properties": { + "name": { + "type": "string" + }, + "arguments": { + "type": "array", + "items": { "type": "object", - "required": ["email"], + "required": ["name"], "properties": { "name": { "type": "string" }, - "email": { + "type": { + "type": "string" + }, + "description": { "type": "string" } }, "additionalProperties": false - }, - "tags": { - "$ref": "#/$defs/string_or_array_of_strings" - }, - "url": { - "type": "string" } + }, + "description": { + "type": "string" + }, + "docs": { + "$ref": "#/$defs/docs_config" } - } - }, - "groups": { - "type": "array", - "items": { - "type": "object", - "required": ["name", "owner"], + }, + "additionalProperties": false + } + }, + "metrics": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "label", "calculation_method", "expression"], + "if": { "properties": { - "name": { - "type": "string" - }, - "owner": { + "calculation_method": { + "const": "derived" + } + } + }, + "then": { + "required": ["name", "label", "calculation_method", "expression"] + }, + "else": { + "required": [ + "name", + "model", + "label", + "calculation_method", + "expression" + ] + }, + "properties": { + "config": { + "type": "object", + "properties": { + "enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "treat_null_values_as_zero": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "group": { + "type": "string" + } + } + }, + "calculation_method": { + "type": "string" + }, + "description": { + "type": "string" + }, + "dimensions": { + "$ref": "#/$defs/array_of_strings" + }, + "expression": { + "type": "string" + }, + "filters": { + "type": "array", + "items": { "type": "object", - "minProperties": 1, + "required": ["field", "operator", "value"], "properties": { - "name": { + "field": { + "type": "string" + }, + "operator": { "type": "string" }, - "email": { + "value": { "type": "string" } }, - "additionalProperties": true + "additionalProperties": false } }, - "additionalProperties": false - } - }, - "macros": { - "type": "array", - "items": { - "type": "object", - "required": ["name"], - "properties": { - "name": { - "type": "string" - }, - "arguments": { - "type": "array", - "items": { - "type": "object", - "required": ["name"], - "properties": { - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "description": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "description": { - "type": "string" - }, - "docs": { - "$ref": "#/$defs/docs_config" - } + "label": { + "type": "string" }, - "additionalProperties": false - } - }, - "metrics": { - "type": "array", - "items": { - "type": "object", - "required": ["name", "label", "calculation_method", "expression"], - "if": { + "meta": { + "type": "object" + }, + "model": { + "type": "string", + "default": "ref('')" + }, + "name": { + "type": "string" + }, + "time_grains": { + "$ref": "#/$defs/array_of_strings" + }, + "timestamp": { + "type": "string" + }, + "window": { + "type": "object", "properties": { - "calculation_method": { - "const": "derived" + "count": { + "type": "integer" + }, + "period": { + "type": "string", + "enum": ["day", "week", "month", "year"] } } + } + }, + "additionalProperties": false + } + }, + "models": { + "type": "array", + "items": { + "type": "object", + "required": ["name"], + "properties": { + "name": { + "type": "string" }, - "then": { - "required": ["name", "label", "calculation_method", "expression"] + "access": { + "type": "string", + "enum": ["private", "protected", "public"] }, - "else": { - "required": [ - "name", - "model", - "label", - "calculation_method", - "expression" - ] + "columns": { + "type": "array", + "items": { + "$ref": "#/$defs/column_properties" + } }, - "properties": { - "config": { + "config": { + "$ref": "#/$defs/model_configs" + }, + "constraints": { + "$ref": "#/$defs/constraints" + }, + "description": { + "type": "string" + }, + "docs": { + "$ref": "#/$defs/docs_config" + }, + "group": { + "type": "string" + }, + "latest_version": { + "type": "number" + }, + "meta": { + "type": "object" + }, + "tests": { + "type": "array", + "items": { + "$ref": "#/$defs/tests" + } + }, + "versions": { + "type": "array", + "items": { "type": "object", + "required": ["v"], "properties": { - "enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" + "v": { + "type": "number" }, - "treat_null_values_as_zero": { - "$ref": "#/$defs/boolean_or_jinja_string" + "config": { + "$ref": "#/$defs/model_configs" }, - "group": { - "type": "string" + "columns": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/$defs/include_exclude" + }, + { + "$ref": "#/$defs/column_properties" + } + ] + } } } - }, - "calculation_method": { - "type": "string" - }, - "description": { - "type": "string" - }, - "dimensions": { - "$ref": "#/$defs/array_of_strings" - }, - "expression": { - "type": "string" - }, - "filters": { - "type": "array", - "items": { - "type": "object", - "required": ["field", "operator", "value"], - "properties": { - "field": { - "type": "string" - }, - "operator": { - "type": "string" - }, - "value": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "label": { - "type": "string" - }, - "meta": { - "type": "object" - }, - "model": { - "type": "string", - "default": "ref('')" - }, - "name": { - "type": "string" - }, - "time_grains": { - "$ref": "#/$defs/array_of_strings" - }, - "timestamp": { - "type": "string" - }, - "window": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "period": { - "type": "string", - "enum": [ "day", "week", "month", "year"] - } - } } + } + }, + "additionalProperties": false + } + }, + "seeds": { + "type": "array", + "items": { + "type": "object", + "required": ["name"], + "properties": { + "name": { + "type": "string" }, - "additionalProperties": false - } - }, - "models": { - "type": "array", - "items": { - "type": "object", - "required": ["name"], - "properties": { - "name": { - "type": "string" - }, - "access": { - "type": "string", - "enum": ["private", "protected", "public"] - }, - "columns": { - "type": "array", - "items": { - "$ref": "#/$defs/column_properties" - } - }, - "config": { - "$ref": "#/$defs/model_configs" - }, - "constraints": { - "$ref": "#/$defs/constraints" - }, - "description": { - "type": "string" - }, - "docs": { - "$ref": "#/$defs/docs_config" - }, - "group": { - "type": "string" - }, - "latest_version": { - "type": "number" - }, - "meta": { - "type": "object" - }, - "tests": { - "type": "array", - "items": { - "$ref": "#/$defs/tests" - } - }, - "versions": { - "type": "array", - "items": { - "type": "object", - "required": ["v"], - "properties": { - "v": { - "type": "number" - }, - "config": { - "$ref": "#/$defs/model_configs" - }, - "columns": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/include_exclude" - }, - { - "$ref": "#/$defs/column_properties" - } - ] - } - } - } - } + "columns": { + "type": "array", + "items": { + "$ref": "#/$defs/column_properties" } }, - "additionalProperties": false - } - }, - "seeds": { - "type": "array", - "items": { - "type": "object", - "required": ["name"], - "properties": { - "name": { - "type": "string" - }, - "columns": { - "type": "array", - "items": { - "$ref": "#/$defs/column_properties" - } - }, - "config": { - "type": "object", - "properties": { - "column_types": { - "type": "object" - }, - "copy_grants": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "database": { - "type": "string" - }, - "enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "quote_columns": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "schema": { - "type": "string" - } + "config": { + "type": "object", + "properties": { + "column_types": { + "type": "object" + }, + "copy_grants": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "database": { + "type": "string" + }, + "enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "grants": { + "$ref": "#/$defs/grants" + }, + "quote_columns": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "schema": { + "type": "string" } - }, - "description": { - "type": "string" - }, - "docs": { - "$ref": "#/$defs/docs_config" - }, - "tests": { - "type": "array", - "items": { - "$ref": "#/$defs/tests" + } + }, + "description": { + "type": "string" + }, + "docs": { + "$ref": "#/$defs/docs_config" + }, + "tests": { + "type": "array", + "items": { + "$ref": "#/$defs/tests" + } + } + }, + "additionalProperties": false + } + }, + "snapshots": { + "type": "array", + "items": { + "type": "object", + "required": ["name"], + "properties": { + "name": { + "type": "string" + }, + "columns": { + "type": "array", + "items": { + "$ref": "#/$defs/column_properties" + } + }, + "config": { + "type": "object", + "properties": { + "alias": { + "type": "string" + }, + "check_cols": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "grants": { + "$ref": "#/$defs/grants" + }, + "persist_docs": { + "$ref": "#/$defs/persist_docs_config" + }, + "post-hook": { + "$ref": "#/$defs/array_of_strings" + }, + "pre-hook": { + "$ref": "#/$defs/array_of_strings" + }, + "quote_columns": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "strategy": { + "type": "string" + }, + "tags": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "target_database": { + "type": "string" + }, + "target_schema": { + "type": "string" + }, + "unique_key": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "updated_at": { + "type": "string" } } }, - "additionalProperties": false - } - }, - "snapshots": { - "type": "array", - "items": { - "type": "object", - "required": ["name"], - "properties": { - "name": { - "type": "string" - }, - "columns": { - "type": "array", - "items": { - "$ref": "#/$defs/column_properties" + "description": { + "type": "string" + }, + "docs": { + "$ref": "#/$defs/docs_config" + }, + "meta": { + "type": "object" + }, + "tests": { + "type": "array", + "items": { + "$ref": "#/$defs/tests" + } + } + }, + "additionalProperties": false + } + }, + "sources": { + "type": "array", + "items": { + "type": "object", + "required": ["name"], + "properties": { + "name": { + "type": "string", + "description": "How you will identify the schema in {{ source() }} calls. Unless `schema` is also set, this will be the name of the schema in the database." + }, + "config": { + "type": "object" + }, + "database": { + "type": "string" + }, + "description": { + "type": "string" + }, + "freshness": { + "$ref": "#/$defs/freshness_definition" + }, + "loaded_at_field": { + "type": "string" + }, + "loader": { + "type": "string" + }, + "meta": { + "type": "object" + }, + "overrides": { + "title": "Package to Override", + "type": "string", + "description": "The name of another package installed in your project. If that package has a source with the same name as this one, its properties will be applied on top of the base properties of the overridden source. https://docs.getdbt.com/reference/resource-properties/overrides" + }, + "quoting": { + "type": "object", + "properties": { + "database": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "identifier": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "schema": { + "$ref": "#/$defs/boolean_or_jinja_string" } }, - "config": { + "additionalProperties": false + }, + "schema": { + "type": "string", + "description": "The schema name as stored in the database. Only needed if you want to use a different `name` than what exists in the database (otherwise `name` is used by default)" + }, + "tables": { + "type": "array", + "items": { "type": "object", + "required": ["name"], "properties": { - "alias": { - "type": "string" - }, - "check_cols": { - "$ref": "#/$defs/string_or_array_of_strings" - }, - "enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "grants": { - "type": "object" - }, - "persist_docs": { - "$ref": "#/$defs/persist_docs_config" + "name": { + "title": "Name", + "type": "string", + "description": "How you will identify the table in {{ source() }} calls. Unless `identifier` is also set, this will be the name of the table in the database." }, - "post-hook": { - "$ref": "#/$defs/array_of_strings" + "columns": { + "type": "array", + "items": { + "$ref": "#/$defs/column_properties" + } }, - "pre-hook": { - "$ref": "#/$defs/array_of_strings" + "description": { + "type": "string" }, - "quote_columns": { - "$ref": "#/$defs/boolean_or_jinja_string" + "external": { + "type": "object" }, - "strategy": { - "type": "string" + "freshness": { + "$ref": "#/$defs/freshness_definition" }, - "tags": { - "$ref": "#/$defs/string_or_array_of_strings" + "identifier": { + "title": "Identifier", + "type": "string", + "description": "The table name as stored in the database. Only needed if you want to give the source a different name than what exists in the database (otherwise `name` is used by default)" }, - "target_database": { - "type": "string" + "loaded_at_field": { + "type": "string", + "description": "Which column to check during data freshness tests. Only needed if the table has a different loaded_at_field to the one defined on the source overall." }, - "target_schema": { - "type": "string" + "loader": { + "type": "string" }, - "unique_key": { - "$ref": "#/$defs/string_or_array_of_strings" + "meta": { + "type": "object" }, - "updated_at": { - "type": "string" - } - } - }, - "description": { - "type": "string" - }, - "docs": { - "$ref": "#/$defs/docs_config" - }, - "meta": { - "type": "object" - }, - "tests": { - "type": "array", - "items": { - "$ref": "#/$defs/tests" - } - } - }, - "additionalProperties": false - } - }, - "sources": { - "type": "array", - "items": { - "type": "object", - "required": ["name"], - "properties": { - "name": { - "type": "string", - "description": "How you will identify the schema in {{ source() }} calls. Unless `schema` is also set, this will be the name of the schema in the database." - }, - "config": { - "type": "object" - }, - "database": { - "type": "string" - }, - "description": { - "type": "string" - }, - "freshness": { - "$ref": "#/$defs/freshness_definition" - }, - "loaded_at_field": { - "type": "string" - }, - "loader": { - "type": "string" - }, - "meta": { - "type": "object" - }, - "overrides": { - "title": "Package to Override", - "type": "string", - "description": "The name of another package installed in your project. If that package has a source with the same name as this one, its properties will be applied on top of the base properties of the overridden source. https://docs.getdbt.com/reference/resource-properties/overrides" - }, - "quoting": { - "type": "object", - "properties": { - "database": { - "$ref": "#/$defs/boolean_or_jinja_string" + "quoting": { + "type": "object", + "properties": { + "database": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "identifier": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "schema": { + "$ref": "#/$defs/boolean_or_jinja_string" + } + }, + "additionalProperties": false }, - "identifier": { - "$ref": "#/$defs/boolean_or_jinja_string" + "tags": { + "$ref": "#/$defs/string_or_array_of_strings" }, - "schema": { - "$ref": "#/$defs/boolean_or_jinja_string" + "tests": { + "type": "array", + "items": { + "$ref": "#/$defs/tests" + } } }, "additionalProperties": false - }, - "schema": { - "type": "string", - "description": "The schema name as stored in the database. Only needed if you want to use a different `name` than what exists in the database (otherwise `name` is used by default)" - }, - "tables": { - "type": "array", - "items": { - "type": "object", - "required": ["name"], - "properties": { - "name": { - "title": "Name", - "type": "string", - "description": "How you will identify the table in {{ source() }} calls. Unless `identifier` is also set, this will be the name of the table in the database." - }, - "columns": { - "type": "array", - "items": { - "$ref": "#/$defs/column_properties" - } - }, - "description": { - "type": "string" - }, - "external": { - "type": "object" - }, - "freshness": { - "$ref": "#/$defs/freshness_definition" - }, - "identifier": { - "title": "Identifier", - "type": "string", - "description": "The table name as stored in the database. Only needed if you want to give the source a different name than what exists in the database (otherwise `name` is used by default)" - }, - "loaded_at_field": { - "type": "string", - "description": "Which column to check during data freshness tests. Only needed if the table has a different loaded_at_field to the one defined on the source overall." - }, - "loader": { - "type": "string" - }, - "meta": { - "type": "object" - }, - "quoting": { - "type": "object", - "properties": { - "database": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "identifier": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "schema": { - "$ref": "#/$defs/boolean_or_jinja_string" - } - }, - "additionalProperties": false - }, - "tags": { - "$ref": "#/$defs/string_or_array_of_strings" - }, - "tests": { - "type": "array", - "items": { - "$ref": "#/$defs/tests" - } - } - }, - "additionalProperties": false - } - }, - "tags": { - "$ref": "#/$defs/string_or_array_of_strings" - }, - "tests": { - "type": "array", - "items": { - "$ref": "#/$defs/tests" - } + } + }, + "tags": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "tests": { + "type": "array", + "items": { + "$ref": "#/$defs/tests" } } } } + } + }, + "additionalProperties": false, + "$defs": { + "array_of_strings": { + "type": "array", + "items": { + "type": "string" + } }, - "additionalProperties": false, - "$defs": { - "array_of_strings": { - "type": "array", - "items": { - "type": "string" + "boolean_or_jinja_string": { + "oneOf": [ + { + "$ref": "#/$defs/jinja_string" + }, + { + "type": "boolean" } - }, - "boolean_or_jinja_string": { - "oneOf": [ - { - "$ref": "#/$defs/jinja_string" - }, - { - "type": "boolean" + ], + "additionalProperties": false + }, + "column_properties": { + "type": "object", + "required": ["name"], + "properties": { + "name": { + "type": "string" + }, + "constraints": { + "$ref": "#/$defs/constraints" + }, + "data_type": { + "type": "string" + }, + "description": { + "type": "string" + }, + "meta": { + "type": "object" + }, + "policy_tags": { + "title": "Policy tags", + "type": "array", + "description": "Configurations, specific to BigQuery adapter, used to set policy tags on specific columns, enabling column-level security. Only relevant when `persist_docs.columns` is true.", + "items": { + "type": "string" } - ], - "additionalProperties": false + }, + "quote": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "tests": { + "type": "array", + "items": { + "$ref": "#/$defs/tests" + } + }, + "tags": { + "$ref": "#/$defs/string_or_array_of_strings" + } }, - "column_properties": { + "additionalProperties": false, + "uniqueItems": true + }, + "constraints": { + "type": "array", + "items": { "type": "object", - "required": ["name"], + "required": ["type"], "properties": { - "name": { - "type": "string" - }, - "constraints": { - "$ref": "#/$defs/constraints" + "columns": { + "$ref": "#/$defs/string_or_array_of_strings" }, - "data_type": { + "expression": { "type": "string" }, - "description": { + "name": { "type": "string" }, - "meta": { - "type": "object" - }, - "policy_tags": { - "title": "Policy tags", - "type": "array", - "description": "Configurations, specific to BigQuery adapter, used to set policy tags on specific columns, enabling column-level security. Only relevant when `persist_docs.columns` is true.", - "items": { - "type": "string" - } + "type": { + "type": "string" }, - "quote": { + "warn_unenforced": { "$ref": "#/$defs/boolean_or_jinja_string" }, - "tests": { - "type": "array", - "items": { - "$ref": "#/$defs/tests" - } - }, - "tags": { - "$ref": "#/$defs/string_or_array_of_strings" + "warn_unsupported": { + "$ref": "#/$defs/boolean_or_jinja_string" } + } + } + }, + "docs_config": { + "title": "Docs config", + "type": "object", + "description": "Configurations for the appearance of nodes in the dbt documentation.", + "properties": { + "node_color": { + "type": "string", + "description": "The color of the node on the DAG in the documentation. It must be an Hex code or a valid CSS color name.", + "pattern": "^(#[a-fA-F0-9]{3}|#[a-fA-F0-9]{6}|[^#][a-zA-Z]*)$" }, - "additionalProperties": false, - "uniqueItems": true + "show": { + "type": "boolean", + "default": true + } }, - "constraints": { - "type": "array", - "items": { - "type": "object", - "required": ["type"], - "properties": { - "columns": { - "$ref": "#/$defs/string_or_array_of_strings" - }, - "expression": { - "type": "string" - }, - "name": { - "type": "string" + "additionalProperties": false + }, + "freshness_definition": { + "default": { + "warn_after": { + "count": 1, + "period": "day" + }, + "error_after": { + "count": 2, + "period": "day" + } + }, + "oneOf": [ + { + "type": "object", + "properties": { + "error_after": { + "$ref": "#/$defs/freshness_rules" }, - "type": { + "filter": { "type": "string" }, - "warn_unenforced": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "warn_unsupported": { - "$ref": "#/$defs/boolean_or_jinja_string" + "warn_after": { + "$ref": "#/$defs/freshness_rules" } - } + }, + "additionalProperties": false + }, + { + "const": null + } + ] + }, + "freshness_rules": { + "type": "object", + "required": ["count", "period"], + "properties": { + "count": { + "$ref": "#/$defs/number_or_jinja_string" + }, + "period": { + "type": "string", + "enum": ["minute", "hour", "day"] } }, - "docs_config": { - "title": "Docs config", - "type": "object", - "description": "Configurations for the appearance of nodes in the dbt documentation.", - "properties": { - "node_color": { - "type": "string", - "description": "The color of the node on the DAG in the documentation. It must be an Hex code or a valid CSS color name.", - "pattern": "^(#[a-fA-F0-9]{3}|#[a-fA-F0-9]{6}|[^#][a-zA-Z]*)$" - }, - "show": { - "type": "boolean", - "default": true - } + "additionalProperties": false + }, + "grants": { + "type": "object", + "description": "grant config. each key is a database permission and the value is the grantee of that permission", + "patternProperties": { + ".*": { + "$ref": "#/$defs/string_or_array_of_strings" + } + }, + "additionalProperties": false + }, + "include_exclude": { + "type": "object", + "properties": { + "include": { + "$ref": "#/$defs/string_or_array_of_strings" }, - "additionalProperties": false + "exclude": { + "$ref": "#/$defs/string_or_array_of_strings" + } + } + }, + "jinja_string": { + "type": "string", + "pattern": "\\{\\{.*\\}\\}" }, - "freshness_definition": { - "default": { - "warn_after": { - "count": 1, - "period": "day" - }, - "error_after": { - "count": 2, - "period": "day" + "model_configs": { + "type": "object", + "properties": { + "contract": { + "type": "object", + "properties": { + "enforced": { + "$ref": "#/$defs/boolean_or_jinja_string" + } } }, - "oneOf": [ - { + "file_format": { + "type": "string" + }, + "grant_access_to": { + "title": "Authorized views", + "type": "array", + "description": "Configuration, specific to BigQuery adapter, used to setup authorized views.", + "items": { "type": "object", + "required": ["database", "project"], "properties": { - "error_after": { - "$ref": "#/$defs/freshness_rules" - }, - "filter": { + "database": { "type": "string" }, - "warn_after": { - "$ref": "#/$defs/freshness_rules" + "project": { + "type": "string" } }, "additionalProperties": false - }, - { - "const": null - } - ] - }, - "freshness_rules": { - "type": "object", - "required": ["count", "period"], - "properties": { - "count": { - "$ref": "#/$defs/number_or_jinja_string" - }, - "period": { - "type": "string", - "enum": ["minute", "hour", "day"] } }, - "additionalProperties": false - }, - "include_exclude": { - "type": "object", - "properties": { - "include": { - "$ref": "#/$defs/string_or_array_of_strings" + "grants": { + "$ref": "#/$defs/grants" + }, + "hours_to_expiration": { + "type": "number", + "description": "Configuration specific to BigQuery adapter used to set an expiration delay (in hours) to a table." + }, + "kms_key_name": { + "type": "string", + "description": "Configuration of the KMS key name, specific to BigQuery adapter.", + "pattern": "projects/[a-zA-Z0-9_-]*/locations/[a-zA-Z0-9_-]*/keyRings/.*/cryptoKeys/.*" + }, + "labels": { + "title": "Label configs", + "type": "object", + "description": "Configuration specific to BigQuery adapter used to add labels and tags to tables/views created by dbt.", + "patternProperties": { + "^[a-z][a-z0-9_-]{0,62}$": { + "type": "string", + "pattern": "^[a-z0-9_-]{0,63}$" + } }, - "exclude": { - "$ref": "#/$defs/string_or_array_of_strings" - } + "additionalProperties": false + }, + "location": { + "type": "string" + }, + "materialized": { + "type": "string" + }, + "sql_header": { + "type": "string" + } + } + }, + "number_or_jinja_string": { + "oneOf": [ + { + "$ref": "#/$defs/jinja_string" + }, + { + "type": "number" + } + ], + "additionalProperties": false + }, + "persist_docs_config": { + "title": "Persist docs config", + "type": "object", + "description": "Configurations for the persistence of the dbt documentation.", + "properties": { + "columns": { + "$ref": "#/$defs/boolean_or_jinja_string", + "default": true + }, + "relation": { + "$ref": "#/$defs/boolean_or_jinja_string", + "default": true } }, - "jinja_string": { - "type": "string", - "pattern": "\\{\\{.*\\}\\}" - }, - "model_configs": { - "type": "object", - "properties": { - "contract": { - "type": "object", - "properties": { - "enforced": { - "$ref": "#/$defs/boolean_or_jinja_string" - } + "additionalProperties": false + }, + "string_or_array_of_strings": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/$defs/array_of_strings" + } + ] + }, + "test_configs": { + "title": "Test configs", + "type": "object", + "description": "Configurations set here will override configs set in dbt_project.yml.", + "properties": { + "alias": { + "type": "string", + "description": "Only relevant when `store_failures` is true" + }, + "database": { + "type": "string", + "description": "Only relevant when `store_failures` is true" + }, + "enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "error_if": { + "type": "string" + }, + "fail_calc": { + "type": "string" + }, + "limit": { + "type": "number" + }, + "schema": { + "type": "string", + "description": "Only relevant when `store_failures` is true" + }, + "severity": { + "oneOf": [ + { + "$ref": "#/$defs/jinja_string" + }, + { + "type": "string", + "enum": ["warn", "error"] } - }, - "file_format": { - "type": "string" - }, - "grant_access_to": { - "title": "Authorized views", - "type": "array", - "description": "Configuration, specific to BigQuery adapter, used to setup authorized views.", - "items": { + ] + }, + "store_failures": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "tags": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "warn_if": { + "type": "string" + } + } + }, + "tests": { + "anyOf": [ + { + "type": "string" + }, + { + "title": "Relationships Test", + "type": "object", + "properties": { + "relationships": { "type": "object", - "required": ["database", "project"], + "required": ["to", "field"], "properties": { - "database": { + "name": { "type": "string" }, - "project": { + "config": { + "$ref": "#/$defs/test_configs" + }, + "field": { + "title": "Relationships: Field", + "type": "string", + "default": "", + "description": "The foreign key column" + }, + "to": { + "type": "string", + "default": "ref('')", + "examples": [ + "ref('parent_model')", + "source('parent_schema', 'parent_table')" + ] + }, + "where": { "type": "string" } - }, - "additionalProperties": false - } - }, - "hours_to_expiration": { - "type": "number", - "description": "Configuration specific to BigQuery adapter used to set an expiration delay (in hours) to a table." - }, - "kms_key_name": { - "type": "string", - "description": "Configuration of the KMS key name, specific to BigQuery adapter.", - "pattern": "projects/[a-zA-Z0-9_-]*/locations/[a-zA-Z0-9_-]*/keyRings/.*/cryptoKeys/.*" - }, - "labels": { - "title": "Label configs", - "type": "object", - "description": "Configuration specific to BigQuery adapter used to add labels and tags to tables/views created by dbt.", - "patternProperties": { - "^[a-z][a-z0-9_-]{0,62}$": { - "type": "string", - "pattern": "^[a-z0-9_-]{0,63}$" } - }, - "additionalProperties": false - }, - "location": { - "type": "string" - }, - "materialized": { - "type": "string" - }, - "sql_header": { - "type": "string" - } - } - }, - "number_or_jinja_string": { - "oneOf": [ - { - "$ref": "#/$defs/jinja_string" - }, - { - "type": "number" - } - ], - "additionalProperties": false - }, - "persist_docs_config": { - "title": "Persist docs config", - "type": "object", - "description": "Configurations for the persistence of the dbt documentation.", - "properties": { - "columns": { - "$ref": "#/$defs/boolean_or_jinja_string", - "default": true - }, - "relation": { - "$ref": "#/$defs/boolean_or_jinja_string", - "default": true + } } }, - "additionalProperties": false - }, - "string_or_array_of_strings": { - "oneOf": [ - { - "type": "string" - }, - { - "$ref": "#/$defs/array_of_strings" - } - ] - }, - "test_configs": { - "title": "Test configs", - "type": "object", - "description": "Configurations set here will override configs set in dbt_project.yml.", - "properties": { - "alias": { - "type": "string", - "description": "Only relevant when `store_failures` is true" - }, - "database": { - "type": "string", - "description": "Only relevant when `store_failures` is true" - }, - "enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "error_if": { - "type": "string" - }, - "fail_calc": { - "type": "string" - }, - "limit": { - "type": "number" - }, - "schema": { - "type": "string", - "description": "Only relevant when `store_failures` is true" - }, - "severity": { - "oneOf": [ - { - "$ref": "#/$defs/jinja_string" - }, - { - "type": "string", - "enum": [ - "warn", - "error" - ] - } - ] - }, - "store_failures": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "tags": { - "$ref": "#/$defs/string_or_array_of_strings" - }, - "warn_if": { - "type": "string" - } - } - }, - "tests": { - "anyOf": [ - { - "type": "string" - }, - { - "title": "Relationships Test", - "type": "object", - "properties": { - "relationships": { - "type": "object", - "required": ["to", "field"], - "properties": { - "name": { - "type": "string" - }, - "config": { - "$ref": "#/$defs/test_configs" - }, - "field": { - "title": "Relationships: Field", - "type": "string", - "default": "", - "description": "The foreign key column" - }, - "to": { - "type": "string", - "default": "ref('')", - "examples": [ - "ref('parent_model')", - "source('parent_schema', 'parent_table')" - ] - }, - "where": { - "type": "string" - } - } - } - } - }, - { - "title": "Accepted Values Test", - "type": "object", - "properties": { - "accepted_values": { - "type": "object", - "required": ["values"], - "properties": { - "name": { - "type": "string" - }, - "config": { - "$ref": "#/$defs/test_configs" - }, - "quote": { - "type": "boolean" - }, - "values": { - "type": "array", - "items": { - "type": "string" - } - }, - "where": { + { + "title": "Accepted Values Test", + "type": "object", + "properties": { + "accepted_values": { + "type": "object", + "required": ["values"], + "properties": { + "name": { + "type": "string" + }, + "config": { + "$ref": "#/$defs/test_configs" + }, + "quote": { + "type": "boolean" + }, + "values": { + "type": "array", + "items": { "type": "string" } + }, + "where": { + "type": "string" } } } - }, - { - "title": "Not Null Test", - "type": "object", - "properties": { - "not_null": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "config": { - "$ref": "#/$defs/test_configs" - }, - "where": { - "type": "string" - } + } + }, + { + "title": "Not Null Test", + "type": "object", + "properties": { + "not_null": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "config": { + "$ref": "#/$defs/test_configs" + }, + "where": { + "type": "string" } } } - }, - { - "title": "Unique Test", - "type": "object", - "properties": { - "unique": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "config": { - "$ref": "#/$defs/test_configs" - }, - "where": { - "type": "string" - } + } + }, + { + "title": "Unique Test", + "type": "object", + "properties": { + "unique": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "config": { + "$ref": "#/$defs/test_configs" + }, + "where": { + "type": "string" } } } } - ] - } + } + ] } + } } diff --git a/tests/1.5/invalid/dbt_project.yml b/tests/1.5/invalid/dbt_project.yml index 9584d5b..cae2f0b 100644 --- a/tests/1.5/invalid/dbt_project.yml +++ b/tests/1.5/invalid/dbt_project.yml @@ -38,6 +38,8 @@ models: +materialized: view +bogus_key: true bogus_key_no_plus: "shonuff" + +grants: + no_numbers: 55 seeds: test: diff --git a/tests/1.5/valid/dbt_project.yml b/tests/1.5/valid/dbt_project.yml index b5e8c94..2a0f81c 100644 --- a/tests/1.5/valid/dbt_project.yml +++ b/tests/1.5/valid/dbt_project.yml @@ -50,6 +50,11 @@ models: contracted_models: +contract: enforced: true + granted_models: + +grants: + privilege: role + privileges: ["select_user", "select_cruiser"] + test_bq: +labels: diff --git a/tests/1.5/valid/dbt_yml_files.yml b/tests/1.5/valid/dbt_yml_files.yml index bbca6d5..61eefff 100644 --- a/tests/1.5/valid/dbt_yml_files.yml +++ b/tests/1.5/valid/dbt_yml_files.yml @@ -3,6 +3,10 @@ models: - name: my_first_dbt_model description: "A starter dbt model" + config: + grants: + privilege: role + privileges: ["select_user", "select_cruiser"] columns: - name: id description: "The primary key for this table" diff --git a/tests/1.6/invalid/dbt_project.yml b/tests/1.6/invalid/dbt_project.yml index b1ee0d9..6961709 100644 --- a/tests/1.6/invalid/dbt_project.yml +++ b/tests/1.6/invalid/dbt_project.yml @@ -39,6 +39,11 @@ models: +materialized: view +bogus_key: true bogus_key_no_plus: "shonuff" + +grants: + no_numbers: 55 + + + seeds: test: diff --git a/tests/1.6/valid/dbt_project.yml b/tests/1.6/valid/dbt_project.yml index 843ca49..8f0de5c 100644 --- a/tests/1.6/valid/dbt_project.yml +++ b/tests/1.6/valid/dbt_project.yml @@ -50,6 +50,10 @@ models: contracted_models: +contract: enforced: true + granted_models: + +grants: + privilege: role + privileges: ["select_user", "select_cruiser"] test_bq: +labels: diff --git a/tests/1.6/valid/dbt_yml_files.yml b/tests/1.6/valid/dbt_yml_files.yml index d3c7f0b..991a3b8 100644 --- a/tests/1.6/valid/dbt_yml_files.yml +++ b/tests/1.6/valid/dbt_yml_files.yml @@ -3,6 +3,10 @@ models: - name: my_first_dbt_model description: "A starter dbt model" + config: + grants: + privilege: role + privileges: ["select_user", "select_cruiser"] columns: - name: id description: "The primary key for this table"