sequence_object:current()
-
object
sequence_object
¶ -
sequence_object:
current
()¶ Since version 2.4.1. Return the last retrieved value of the specified sequence or throw an error if no value has been generated yet (
next()
has not been called yet, orcurrent()
is called right afterreset()
is called).Example:
tarantool> sq = box.schema.sequence.create('test') --- ... tarantool> sq:current() --- - error: Sequence 'test' is not started ... tarantool> sq:next() --- - 1 ... tarantool> sq:current() --- - 1 ... tarantool> sq:set(42) --- ... tarantool> sq:current() --- - 42 ... tarantool> sq:reset() --- ... tarantool> sq:current() -- error --- - error: Sequence 'test' is not started ...
-