Skip to content

Releases: Snowflake-Labs/dbt_constraints

dbt Constraints v0.5.2

01 Nov 16:12
a7e2da6
Compare
Choose a tag to compare

What's Changed

  • Updated documentation to reference Snowflake's new support for Join Elimination
  • CTE Column Names fix for Redshift by @ataft in #31
  • Fix to include snapshots in match for fk model names by @ciejer in #35
  • Redshift: Replace statement with run_query by @ataft in #33

New Contributors

Full Changelog: 0.5.1...0.5.2

dbt Constraints v0.5.1

27 Sep 00:12
f15affc
Compare
Choose a tag to compare

New Features

  • Added support for AWS Redshift by @ataft in #28

Fixes

New Contributors

  • @ataft made their first contribution in #28

Full Changelog: 0.5.0...0.5.1

dbt Constraints v0.5.0

22 Sep 21:45
a010c95
Compare
Choose a tag to compare

New Features

  • dbt Constraints now generates not null constraints in addition to PK, UK, and FK. @l-gysin provided the initial code for not null constraints and @sfc-gh-dflippo extended it during testing for compound primary keys on all three databases.

Fixes

  • @lbk-fishtown identified and fixed an issue that prevented constraints on Snapshots

Known issues

None

New Contributors

Full Changelog: 0.4.2...0.5.0

dbt Constraints v0.4.2

02 Sep 15:48
2d6eada
Compare
Choose a tag to compare

What's Changed

  • Removed packages.yml by @sfc-gh-dflippo in #23
    We have not required dbt_utils for many versions and I just neglected to remove the packages.yml from the package. I am still referencing dbt_utils in the integration test project however because I still support creating UK from its unique_combination_of_columns test. That reference is open ended so it will always test the latest version.

Full Changelog: 0.4.1...0.4.2

dbt Constraints v0.4.1

11 Aug 14:49
822dd1b
Compare
Choose a tag to compare

New Features

None

Fixes

  • Handling the Postgres identifier length limits by @ArtemHU in #18
  • Handling Oracle identifier limits by @danflippo
  • Fixed a small issue on the Oracle macro related to upper/lower case table names that was causing FK to be skipped because the logic was not correctly looking up whether any PK/UK existed on the parent table by @danflippo

Known issues

None

New Contributors

Full Changelog: 0.4.0...0.4.1

dbt Constraints v0.4.0

26 Jun 22:31
3559fa9
Compare
Choose a tag to compare

New Features

  • This release adds support for the Oracle database. Additional fixes to support dbt Constraints were made by Oracle in their dbt adapter so it is important to upgrade to dbt-Oracle version 1.0.4 or later.

Fixes

None

Known issues

None

Full Changelog: 0.3.2...0.4.0

dbt Constraints v0.3.2

21 Jun 14:29
Compare
Choose a tag to compare

New Features

  • On PostgreSQL, the package will now drop PK/UK/FK on tables before truncating them to avoid errors with seeds. The package declares a truncate_relation() macro that does the drops before calling the dbt core truncate_relation() macro.

Fixes

  • On PostgreSQL, adds a commit after each ALTER since DDL is transactional
  • Modified the SQL for the foreign_key test to use a LEFT JOIN instead of an IN (SELECT subquery. The SQL is logically identical and Snowflake's query optimizer was already rewriting the subquery behind the scenes. However, on PostgreSQL the subquery SQL has much worse performance compared to the join SQL. Apparently dbt-Labs made the same change themselves in their relationship test. Now the SQL is very similar to the latest relationship test's SQL but supports compound keys whereasrelationship only supports one column.

Known issues

None

Full Changelog: 0.3.1...0.3.2

dbt Constraints v0.3.1

06 Jun 16:05
e695926
Compare
Choose a tag to compare

New Features

None

Fixes

  • Added logic to skip constraints when a test has a where set on the test. You can't set conditions on whether a PK/UK/FK applies so such tests are not appropriate to make into physical constraints
  • Updated the logic to support table alias
  • Added a fix that caused dbt Constraints to fail when a user has a singular test. The logic needs to verify a test_metadata node exists before checking the test_metadata.name node to see if it is a supported test to turn into a constraint.

Known issues

None

Full Changelog: 0.3.0...0.3.1

dbt Constraints v0.3.0

02 May 22:04
6c9fca6
Compare
Choose a tag to compare

First release on Snowflake-Labs and shortly on dbt Hub

The documentation has been updated to reflect the new URL of the repository. I have also added the packages.yml instructions for the dbt Hub in anticipation of its release there.

dbt Constraints v0.2.0

26 Apr 12:30
e3c2e5e
Compare
Choose a tag to compare

New Features

  • This release adds optional support for constraints on sources. These are not enabled by default but can be enabled using a variable.
  • In order to add source constraint support, two additional macros are now needed for each database because we now need to verify database permissions. It could be presumed that dbt projects had OWNERSHIP on models but that is not something that should be assumed for sources. Each constraint with a source will now lookup OWNERSHIP and REFERENCES permissions as necessary for PK, UK, and FK. For performance reasons I have skipped checking permissions for constraints that only have models.
  • Documentation has been updated and a new TROUBLESHOOTING.md file has been added with all the logged error messages and some tips for how to resolve the message. These are non-fatal messages such ask skipping a FK because a PK/UK does not exist.

Fixes

None

Known issues

None