Releases: Snowflake-Labs/dbt_constraints
Releases · Snowflake-Labs/dbt_constraints
dbt Constraints v0.5.2
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
New Features
Fixes
- Moved not_null constraints first by @sfc-gh-dflippo in #30. Issue identified by @ataft
New Contributors
Full Changelog: 0.5.0...0.5.1
dbt Constraints v0.5.0
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
- @lbk-fishtown made their first contribution in #24
- @l-gysin made their first contribution in #22
Full Changelog: 0.4.2...0.5.0
dbt Constraints v0.4.2
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
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
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
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 aLEFT JOIN
instead of anIN (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 theirrelationship
test. Now the SQL is very similar to the latestrelationship
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
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
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
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