From d142fa4d28e0e6f32b5c2b61cd15637ecd995cd5 Mon Sep 17 00:00:00 2001 From: enemik Date: Thu, 4 Jul 2019 23:48:21 +0200 Subject: [PATCH] Implemented and validated all schema tests --- README.md | 7 ++++--- dbt/include/sqlserver/macros/schema_tests.sql | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 11e78cb5..928610b1 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Easiest install is to use pip: ### Materializations - Table: - - Will be materialized as columns store index by default (requires SQL Server 2017 as least). To override specify: + - Will be materialized as columns store index by default (requires SQL Server 2017 as least). To override: {{ config( as_columnstore = false, @@ -44,10 +44,11 @@ Easiest install is to use pip: ### Sources ### Testing & documentation -- Unique: Is the only test tested so far. The rest will be tested and added if possible soon. - +- All tests supported - Docs ### Snapshots - Timestamp - Check + +But, all columns in source table needs to be set to allow NULL. If any column has a NOT NULL constraint, an error will be thrown. \ No newline at end of file diff --git a/dbt/include/sqlserver/macros/schema_tests.sql b/dbt/include/sqlserver/macros/schema_tests.sql index 17051113..c21c1418 100644 --- a/dbt/include/sqlserver/macros/schema_tests.sql +++ b/dbt/include/sqlserver/macros/schema_tests.sql @@ -6,7 +6,7 @@ select count(*) as validation_errors from ( select - {{ column_name }} + {{ column_name }} as validation_errors from {{ model }} where {{ column_name }} is not null