Skip to content

Add method validate to box.tuple.format #5134

Open
@TarantoolBot

Description

@TarantoolBot

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.5featureA new functionalityreference[location] Tarantool manual, Reference part

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions