Skip to content

dbt Constraints v0.3.2

Compare
Choose a tag to compare
@sfc-gh-dflippo sfc-gh-dflippo released this 21 Jun 14:29
· 106 commits to main since this release

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