feat(nulltest): add not_null option to unique_combination_of_columns.sql #964
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add option to enforce uniqueness and non-null constraints on composite primary key columns in one test.
This introduces an option to ensure that composite primary key columns are both unique and do not contain null values. This is beneficial as it reduces the need for duplicate tests by allowing these constraints to be specified directly in a single test.
resolves #963
Problem
I perform unique and not null tests on all primary key columns. Previously, not_null data tests had to be specified repeatedly for the same columns that are also listed in the unique_combination_of_columns test.
Solution
The proposed solution adds an optional for loop that performs not null tests on each column in the unique_combination_of_columns test. Gives neater code. The default parameter is false, so it should not be a breaking change.
One problem can be that putting them together in one test may make it difficult to see which part of the test failed.
Checklist