We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The only way to validate a tuple against a space format without inserting it into the space is using box.tuple.new with the format option:
box.tuple.new
format
tarantool> box.tuple.new({'a', 1}, {format = box.space._schema:format()}) --- - ['a', 1] ... tarantool> box.tuple.new({1, 2}, {format = box.space._schema:format()}) --- - error: 'Tuple field 1 (key) type does not match one required by operation: expected string, got unsigned' ...
It'd be nice if a tuple format object had the validate method so that we wouldn't have to create a new tuple in this case:
validate
local format = box.tuple.format.new({{'key', 'string'}, {'value', 'any'}}) format:validate({'a', 1}) -- ok format:validate(box.tuple.new({'a', 1})) -- ok format:validate({1, 2}) -- error format:validate(box.tuple.new({1, 2})) -- error
Similarly to index.parts, it should be possible to use validate with space.format:
index.parts
space.format
box.space._schema.format -- returns format object box.space._schema.format:validate({'a', 1}) -- ok box.space._schema.format:validate(box.tuple.new({'a', 1})) -- ok box.space._schema.format:validate({1, 2}) -- error box.space._schema.format:validate(box.tuple.new({1, 2})) -- error
Similar tickets for key_def and index.parts:
key_def
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The only way to validate a tuple against a space format without inserting it into the space is using
box.tuple.new
with theformat
option:It'd be nice if a tuple format object had the
validate
method so that we wouldn't have to create a new tuple in this case:Similarly to
index.parts
, it should be possible to usevalidate
withspace.format
:Similar tickets for
key_def
andindex.parts
:key_def
module #9863The text was updated successfully, but these errors were encountered: