diff --git a/core/table.ts b/core/table.ts index a5af2516d..0e16afda2 100644 --- a/core/table.ts +++ b/core/table.ts @@ -82,6 +82,9 @@ export class Table { if (config.disabled) { this.disabled(); } + if (config.protected) { + this.protected(); + } if (config.redshift) { this.redshift(config.redshift); } @@ -137,6 +140,11 @@ export class Table { return this; } + public protected() { + this.proto.protected = true; + return this; + } + public sqldatawarehouse(sqlDataWarehouse: dataform.ISQLDataWarehouseOptions) { this.proto.sqlDataWarehouse = dataform.SQLDataWarehouseOptions.create(sqlDataWarehouse); return this; diff --git a/examples/bigquery_language_v2/definitions/example_incremental.sqlx b/examples/bigquery_language_v2/definitions/example_incremental.sqlx index 81541ebfc..ac78ef7a2 100644 --- a/examples/bigquery_language_v2/definitions/example_incremental.sqlx +++ b/examples/bigquery_language_v2/definitions/example_incremental.sqlx @@ -1,4 +1,4 @@ -config { type: "incremental" } +config { type: "incremental", protected: true } js { const crossdb = require("@dataform/crossdb"); } diff --git a/tests/api/api.spec.ts b/tests/api/api.spec.ts index b93ad8cca..bde78982e 100644 --- a/tests/api/api.spec.ts +++ b/tests/api/api.spec.ts @@ -697,6 +697,7 @@ describe("@dataform/api", () => { t.name === schemaWithSuffix("df_integration_test") + ".example_incremental" ); expect(exampleIncremental).to.not.be.undefined; + expect(exampleIncremental.protected).eql(true); expect(exampleIncremental.query.trim()).equals("select current_timestamp() as ts"); expect(exampleIncremental.where.trim()).equals( `ts > (select max(ts) from \`tada-analytics.${schemaWithSuffix( diff --git a/version.bzl b/version.bzl index 623e36010..c6dc068e1 100644 --- a/version.bzl +++ b/version.bzl @@ -1,3 +1,3 @@ # NOTE: If you change the format of this line, you must change the bash command # in /scripts/publish to extract the version string correctly. -DF_VERSION = "1.3.3" +DF_VERSION = "1.3.4"