|
4 | 4 | Constraints |
5 | 5 | =========== |
6 | 6 |
|
| 7 | +.. index:: constraint, validation, exclusive, expression on, one_of, max_value, |
| 8 | + max_ex_value, min_value, min_ex_value, max_len_value, min_len_value, |
| 9 | + regexp, __subject__ |
| 10 | + |
7 | 11 | .. important:: |
8 | 12 |
|
9 | 13 | This section assumes a basic understanding of EdgeQL. |
@@ -202,6 +206,8 @@ Constraints can be defined on computed properties. |
202 | 206 | Composite constraints |
203 | 207 | ^^^^^^^^^^^^^^^^^^^^^ |
204 | 208 |
|
| 209 | +.. index:: tuple |
| 210 | + |
205 | 211 | To define a composite constraint, create an ``exclusive`` constraint on a |
206 | 212 | tuple of properties or links. |
207 | 213 |
|
@@ -239,6 +245,8 @@ Partial constraints |
239 | 245 |
|
240 | 246 | .. versionadded:: 2.0 |
241 | 247 |
|
| 248 | +.. index:: constraint exclusive on, except |
| 249 | + |
242 | 250 | Constraints on object types can be made partial, so that they don't apply |
243 | 251 | when some condition holds. |
244 | 252 |
|
@@ -333,6 +341,8 @@ Link ``@source`` and ``@target`` constraints |
333 | 341 |
|
334 | 342 | .. versionadded:: 4.0 |
335 | 343 |
|
| 344 | +.. index:: constraint exclusive on, @source, @target |
| 345 | + |
336 | 346 | .. note:: |
337 | 347 |
|
338 | 348 | ``@source`` and ``@target`` are available starting with version 4.3. |
@@ -412,6 +422,8 @@ using arbitrary EdgeQL expressions. The example below uses the built-in |
412 | 422 | Constraints and type inheritence |
413 | 423 | -------------------------------- |
414 | 424 |
|
| 425 | +.. index:: delegated constraint |
| 426 | + |
415 | 427 | If you define a constraint on a type and then extend that type, the constraint |
416 | 428 | will *not* be applied individually to each extending type. Instead, it will |
417 | 429 | apply globally across all the types that inherited the constraint. |
|
0 commit comments