-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
api: option to skip nullability check on flatten
Add `skip_nullability_check_on_flatten` option for `insert_object`, `insert_object_many`, `replace_object`, `replace_object_many`. `false` by default. By setting the option to `true` one allows setting null values to non-nullable fields, which can be useful if non-nullable field value is generated by sequence [1]. **Warning**: there is no native support of sequences in sharded systems since each replicaset has its own sequence. If sequence field is a part of the sharding key (which is true by default), choosing the bucket id is the sole responsibility of the developer (#328). The option wasn't added to `upsert_object*` methods since upsert operation doesn't support sequence generated fields: ``` box.schema.space.create('seq', { format = { {name = 'id', type = 'unsigned'}, {name = 'payload', type = 'string'}, }, }) box.schema.sequence.create('id', {if_not_exists = true}) box.space.seq:create_index('id', { parts = {{field = 'id'}}, unique = true, sequence = 'id' } ) box.space.seq:upsert({nil, 'payload'}, {{'=', 'payload', 'payload'}}) ``` ``` --- - error: 'Tuple field 1 (id) type does not match one required by operation: expected unsigned, got nil' ... ``` Refer to #328 discussion regarding solution design. 1. https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_schema_sequence/create_index/ Closes #328
- Loading branch information
1 parent
704bd6f
commit 7504da3
Showing
10 changed files
with
253 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.