Skip to content

Document box_sequence_ C API functions #5024

Open
@mandesero

Description

@mandesero

Product: Tarantool
Since: 1.7.6
Root document: https://www.tarantool.io/en/doc/latest/reference/reference_capi/box/

Details

The following public C API functions are missing in the documentation:

int box_sequence_next(uint32_t seq_id, int64_t *result)
int box_sequence_set(uint32_t seq_id, int64_t value)
int box_sequence_reset(uint32_t seq_id)

Suggested description

int box_sequence_next(uint32_t seq_id, int64_t *result)

Since version 1.7.6. Generate the next value of the specified sequence and update the sequence state accordingly.

Parameters:

  • seq_id (uint32_t) – sequence identifier
  • result (int64_t *) – pointer to a variable where the next sequence value will be stored on success

Returns:
0 on success and -1 otherwise. In case of an error, you can get more details via box_error_last().


int box_sequence_set(uint32_t seq_id, int64_t value)

Since version 1.7.6. Set the specified sequence to the given value.

Parameters:

  • seq_id (uint32_t) – sequence identifier
  • value (int64_t) – the value to set the sequence to

Returns:
0 on success and -1 otherwise. In case of an error, you can get more details via box_error_last().


int box_sequence_reset(uint32_t seq_id)

Since version 1.7.6. Reset the specified sequence to its initial state.
If called outside of an active transaction, this function starts and commits one internally.

Parameters:

  • seq_id (uint32_t) – sequence identifier

Returns:
0 on success and -1 otherwise. In case of an error, you can get more details via box_error_last().

Metadata

Metadata

Assignees

No one assigned

    Labels

    c api[Area] Related to the Tarantool C API reference

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions