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

Remove need for specifying ID in put and cas operations #208

Closed
jonpither opened this issue May 10, 2019 · 2 comments
Closed

Remove need for specifying ID in put and cas operations #208

jonpither opened this issue May 10, 2019 · 2 comments
Labels

Comments

@jonpither
Copy link
Contributor

jonpither commented May 10, 2019

This is a proposed ergonomic change - what do we think of removing the absolute need to supply the ID as an argument to the put and cas operations, when the ID can be easily derived from the supplied documents (currently an error is thrown is the supplied ID differs).

I believe this question has come up, and subjectively, it feels more intuitive to just hand Crux documents, rather than giving it IDs as well. There is also a little less duplication/boilerplate to getting on and using Crux.

Downside of this is a wider API, with overloaded function arguments (as we'd probably want to keep the existing case where you can supply the ID - although worth questioning this also?)

@crimeminister
Copy link

I'm new to crux but for what it's worth I think DRYing up put and cas so that a document ID is only supplied once would be friendlier. I'm relatively agnostic as to whether the ID lives in the document or outside, but would appreciate if there was only the one way to do it. Otherwise I'm liable to start writing macros to ensure that I'm not using it one way in some places and the other way(s) in others. There's no way that ends well. 😄

@hraberg hraberg added this to To do in XTDB Development via automation May 10, 2019
@hraberg hraberg added this to the Beta milestone May 10, 2019
@hraberg hraberg added the tx label May 10, 2019
@hraberg
Copy link
Contributor

hraberg commented May 10, 2019

One reason it works the way it does is to stay consistent with the arguments also for delete and evict, that is, the first argument to a transaction command is always an entity id. Not saying that we need to keep it like that, just providing some background.

XTDB Development automation moved this from To do to Done Jun 14, 2019
@jarohen jarohen removed this from the Beta milestone Nov 15, 2019
@jarohen jarohen added the 1.x label Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants