You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?)
The text was updated successfully, but these errors were encountered:
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. 😄
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.
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?)
The text was updated successfully, but these errors were encountered: