Skip to content

Support for the RELY property of primary and foreign key constraint #1271

Description

@Phil-Garmann

Describe the feature

Add native support for the RELY property of primary and foreign key constraint, by adding an optional, boolean input to the constraint types.

Optional feature extension - QoL safeguard

Setting rely: true would implicitly create the not_null and unique constraints to ensure that the constraint is valid/satisfied. This is purely a safeguard against incorrect query results when the rely option is set but not satisfied.

Describe alternatives you've considered

The behavior is already achievable for primary constraints, as they can be implemented directly as expression using the custom constraint type (introduced in #792). However, for foreign key constraints this is not a viable option as the ref macro is not a part of the limited Jinja context for .yaml files.

Who will this benefit?

One of the main reasons for adding PK/FK constraints is for the potential performance enhancement, which requires the RELY option to be set. Hence, most (if not all) users of these constraints on this adapter would benefit from this feature.

Furthermore, the RELY constraint property is also used by snowflake, extending the appeal and useability of the feature.

Are you interested in contributing this feature?

Yes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions