Skip to content
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

Add update_object operation #368

Open
savinov opened this issue Jun 21, 2023 · 2 comments
Open

Add update_object operation #368

savinov opened this issue Jun 21, 2023 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@savinov
Copy link

savinov commented Jun 21, 2023

Please add update_object operation similarly to upsert_object: https://github.com/tarantool/crud#upsert

@DifferentialOrange
Copy link
Member

The reason why there is insert_object, replace_object and upsert_object and no update_object and delete_object is as follows.

The syntax for insert/replace is space:insert(tuple)/space:replace(tuple). upsert is replace+update, so its syntax is space:upsert(tuple, ops). For insert, replace and upsert it is expected that user should provide a tuple since one may not exist yet.

On the other hand, the syntax for update/delete is index:update(key, ops)/space:delete(key). It is expected that tuple should already exist, so it may be accessed by its key. The object isn't used here, so there is no corresponding _object method yet. On the other hand, we may implement primary key extraction from the key-value object.

Two separate questions could be considered here:

  • allowing to specify index key with {key = value} map for update and delete (through update_object and delete_object ),
  • allowing to use non-primary index for update and delete.

I think we'll discuss these features with product team and then decide either we should or shouldn't support them.

@DifferentialOrange DifferentialOrange added the question Further information is requested label Jun 21, 2023
@savinov
Copy link
Author

savinov commented Jun 24, 2023

On the other hand, we may implement primary key extraction from the key-value object.

That's the purpose of the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants