Skip to content

Add method validate to box.tuple.format #5134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
TarantoolBot opened this issue May 27, 2025 · 0 comments
Open

Add method validate to box.tuple.format #5134

TarantoolBot opened this issue May 27, 2025 · 0 comments
Labels
3.5 feature A new functionality reference [location] Tarantool manual, Reference part

Comments

@TarantoolBot
Copy link
Collaborator

TarantoolBot commented May 27, 2025

Related dev. issue(s): tarantool/tarantool@7a5f36c

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

@AArdeev AArdeev added this to the Estimate [@aardeev] milestone May 30, 2025
@AArdeev AArdeev removed their assignment May 30, 2025
@AArdeev AArdeev added feature A new functionality reference [location] Tarantool manual, Reference part and removed doc_gap labels Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.5 feature A new functionality reference [location] Tarantool manual, Reference part
Projects
None yet
Development

No branches or pull requests

2 participants