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

[FEATURE]: DQL Check Constraint #8410

Closed
jdgamble555 opened this issue Nov 3, 2022 · 1 comment
Closed

[FEATURE]: DQL Check Constraint #8410

jdgamble555 opened this issue Nov 3, 2022 · 1 comment
Labels
community Issue or PR created by the community. kind/feature Something completely new we should consider. Stale

Comments

@jdgamble555
Copy link

Have you tried Dgraph before this proposal? and did not find anything similar?

No response

What you wanted to do.

It would be nice to have basic check constraints in DQL.

type Film {
  name
  release_date
  revenue @check(revenue > 1)
  running_time @check(running_time > 2.0)
  starring(starr
  director
}

SQL has a simple money example.

You could also add it as a top-level directive.

type Persons @check(age >=18 AND City='Sandnes') (
    LastName
    FirstName
    Age
    City
);

regex

type User {
  email @check(email ~* '^[A-Za-z0-9._+%-]+@[A-Za-z0-9.-]+[.][A-Za-z]+$'))
  username @notnull @check(length(username) >= 10);
  ...
}

This would require some basic string functions for matching, and would allow AND, OR etc...

What you actually did.

I would say regex and string functions would come later, but basic checks for greater than, equal to, etc should work initially. This would also have to translate a level up to GraphQL.

Why wasn't it great, with examples.

We can put anything anywhere. This is great sometimes, but other times we want constraints.

Additional information.

This could open up the door for type constraints as well. This would be optional of course. Could come down the line.

@jdgamble555 jdgamble555 added the kind/feature Something completely new we should consider. label Nov 3, 2022
@rderbier rderbier moved this to 📋 Backlog in Feature Requests - PM RoadMap Nov 16, 2022
@rderbier rderbier added the community Issue or PR created by the community. label Dec 15, 2022
@rderbier rderbier moved this from 📋 TRIAGE to LATER in Feature Requests - PM RoadMap Jan 4, 2023
Copy link

This issue has been stale for 60 days and will be closed automatically in 7 days. Comment to keep it open.

@github-actions github-actions bot added the Stale label Jul 31, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Issue or PR created by the community. kind/feature Something completely new we should consider. Stale
Development

No branches or pull requests

2 participants