Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: unique table column validator #99

Merged
merged 2 commits into from
May 14, 2024
Merged

feat: unique table column validator #99

merged 2 commits into from
May 14, 2024

Conversation

vesse
Copy link
Contributor

@vesse vesse commented May 14, 2024

Added unique validator for table column. Usage:

  validators:
    - unique: true
      column: UNIQUE_COL

What's maybe missing:

  • documentation updates
  • should the validator check existing values when updating to a newer recipe version?

@vesse vesse requested a review from majori May 14, 2024 05:47
@vesse vesse linked an issue May 14, 2024 that may be closed by this pull request
pkg/recipe/variable.go Outdated Show resolved Hide resolved
@majori
Copy link
Member

majori commented May 14, 2024

should the validator check existing values when updating to a newer recipe version?

Yeah, the predefined values are checked here:

for i := range targetedVariable.Validators {

@vesse vesse linked an issue May 14, 2024 that may be closed by this pull request
@vesse vesse force-pushed the feat/unique-column branch 3 times, most recently from e7eccbc to d73dd87 Compare May 14, 2024 11:24
@vesse vesse marked this pull request as ready for review May 14, 2024 11:24
examples/variable-types/recipe.yml Outdated Show resolved Hide resolved
@vesse vesse force-pushed the feat/unique-column branch from d73dd87 to bc22a20 Compare May 14, 2024 11:30
Added new validator which ensures values are unique within given column.

Fixes #71
@vesse vesse force-pushed the feat/unique-column branch from bc22a20 to 3775307 Compare May 14, 2024 11:42
@vesse vesse merged commit d187ae9 into main May 14, 2024
4 checks passed
@vesse vesse deleted the feat/unique-column branch May 14, 2024 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add unique column validator for table variable Unique column validator for table variable
2 participants