menu

EdgeDB

Bringing state-of-the-art database technology to the masses.

Channels
Team
Posts
Chat
Members
Info

February 20, 2020 at 6:22am
Hi! I have a quick question about cross-constraints: are they possible and how? :)
  • reply
  • like
https://edgedb.com/docs/edgeql/ddl/constraints#create-constraint mentions "Currently EdgeDB only supports constraint expressions on scalar types and properties." so I'd guess not
  • reply
  • like

February 20, 2020 at 1:40pm
Maybe a function inside a restraint? I don't know if that works (yet) or how to declare it in schematically valid way
  • reply
  • like
there's "on expression" for a more flexible constraint. But I'm not sure if we can access other properties (so, objecttype level) or not (so, property level).
  • reply
  • like
or : Do you know anything about this constraints question above? And if it's possible to pull next values from a sequence object? I couldn't find anything about that in the doc.
  • reply
  • like

February 21, 2020 at 8:18pm
Constraints across multiple links in an object are not supported. Support for constraints across multiple singleton properties in an object type will be added soon (https://github.com/edgedb/edgedb/issues/1164).
  • reply
  • like
And if it's possible to pull next values from a sequence object? I couldn't find anything about that in the doc.
Sequences are incremented implicitly when you're inserting an object with a sequence property. Fetching next values directly is not implemented yet, but should probably be a straightforward addition.
  • reply
  • like