SurrealDB Docs Logo

Enter a search query

Sequence functions

Available since: v3.0.0-alpha.2

These functions can be used to work with sequences.

FunctionDescription
sequence::next()Returns the next value in a sequence.

sequence::next

The sequence::next function returns the next value in a sequence.

API DEFINITION
sequence::next(sequence_name) -> int
DEFINE SEQUENCE mySeq2 BATCH 1000 START 100 TIMEOUT 5s; sequence::nextval('mySeq2'); -- 100