From 048bcae401b41633e58a26d09401a53ad919e41a Mon Sep 17 00:00:00 2001 From: Scott Trinh Date: Wed, 16 Jul 2025 15:16:12 -0400 Subject: [PATCH] Add a bit more guidance about sequence The primary use-case for sequences, auto-incrementing exclusive property, was not well described in the existing documentation. --- docs/reference/stdlib/sequence.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/reference/stdlib/sequence.rst b/docs/reference/stdlib/sequence.rst index cddcde67c81..48fc8bebfdb 100644 --- a/docs/reference/stdlib/sequence.rst +++ b/docs/reference/stdlib/sequence.rst @@ -32,11 +32,16 @@ Sequences scalar type TicketNo extending sequence; type Ticket { - number: TicketNo { + required number: TicketNo { constraint exclusive; } } + A property set to a sequence type has an implicit default of calling + ``sequence_next``. If you are using this as an auto-incrementing exclusive + property, you probably want it to be ``required`` and ensure that you're not + setting the property explicitly when inserting objects. + A sequence is bound to the scalar type, not to the property, so if multiple properties use the same sequence, they will share the same counter. For each distinct counter, a separate