Skip to content

Update by field names #877

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

Closed
Gerold103 opened this issue Aug 28, 2019 · 3 comments
Closed

Update by field names #877

Gerold103 opened this issue Aug 28, 2019 · 3 comments
Assignees
Labels
feature A new functionality manual [location] Tarantool manual, no definite location server [area] Task relates to Tarantool's server (core) functionality

Comments

@Gerold103
Copy link
Contributor

It is possible now to use field names instead of numbers in update operations. It affects all update and upsert functions, such as of space, tuple, index, netbox connector - everything. Note, that field names are valid for update operations, not for update key. You still can't insert a map directly into box. An example:

box.cfg{}
format = {}
format[1] = {'id', 'unsigned'}
format[2] = {'field', 'unsigned'}
s = box.schema.create_space('test', {format = format})
pk = s:create_index('pk')
s:replace{1, 1}
s:update({1}, {'+', 'field', 1})
---
- [1, 2]
...

Introduced by me in tarantool/tarantool@9ee5cf8.

@Totktonada
Copy link
Member

Note that it also affects the binary protocol.

@lenkis lenkis added 2.2 feature A new functionality manual [location] Tarantool manual, no definite location server [area] Task relates to Tarantool's server (core) functionality labels Sep 4, 2019
@pgulutzan
Copy link
Contributor

I tried "s:update({1}, {{'+', 'field', 1}})" with tarantool-2.2 today and the result was: - error: Illegal parameters, field id must be a number. No error with tarantool-master i.e. version 2.3. But we do not have a version-2.3 manual.

@Gerold103
Copy link
Contributor Author

Yes, this feature is in the master branch. So what a problem? We can't create tickets on visible changes in the master?

@pgulutzan pgulutzan added 2.3 and removed 2.2 labels Sep 11, 2019
pgulutzan added a commit that referenced this issue Sep 11, 2019
rybakit added a commit to tarantool-php/client that referenced this issue Sep 23, 2019
lenkis pushed a commit that referenced this issue Dec 27, 2019
(cherry picked from commit 90186ad)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new functionality manual [location] Tarantool manual, no definite location server [area] Task relates to Tarantool's server (core) functionality
Projects
None yet
Development

No branches or pull requests

4 participants