Add method validate to box.tuple.format
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 15
- Forks
- 49
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 3
Description
Related dev. issue(s): https://github.com/tarantool/tarantool/commit/7a5f36cec53994731f31f73e001fc172978df608
Product: Tarantool
Since: 3.5
Root document: https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_tuple/
SME: @ locker
Details
Since: 3.5
To simplify validation of tuples without needing to create or insert them,
a new validate method was added to tuple.format objects.
This method verifies that a tuple (or a Lua table representing a tuple)
conforms to the format. If the tuple is invalid, an error is raised.
Example:
format = box.tuple.format.new({
{name = 'id', type = 'unsigned'},
{name = 'name', type = 'string'},
})
format:validate({1, 'A'}) -- ok
format:validate({true, 'A'}) -- error
TW guidelines
It is suggested that a new page on the same level with https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_tuple/new/ is to be created for the box.tuple.format().
This page will contain current ticket information.
A reference to this page must be added in the note of https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_tuple/format/. This page may also be a donor of general description.
Do together with #5135
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the box.tuple.format reference and the existing box.tuple.new page linked in the issue. Add a sibling reference page documenting format:validate with the supplied behavior and example, then add a reference to it in the note for box.tuple.format. Coordinate this with issue #5135 as requested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100