tarantool / tarantool/doc

Document `box_sequence_` C API functions

Open
#5,024 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

c api
Dominant language
CSS
Stars
15
Forks
49
Avg merge
1d 13h
Merged PRs (30d)
3

Description

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().

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the referenced C API root document and search for the existing sequence documentation and the three function names. Add entries for box_sequence_next(), box_sequence_set(), and box_sequence_reset() using the supplied signatures, parameters, return values, and transaction behavior; done means all three appear in the generated reference.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.