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

Problem: is overwriting key/value with the same value a duplicate? #306

Open
yrashk opened this issue Jun 23, 2017 · 2 comments
Open

Problem: is overwriting key/value with the same value a duplicate? #306

yrashk opened this issue Jun 23, 2017 · 2 comments
Labels

Comments

@yrashk
Copy link
Contributor

yrashk commented Jun 23, 2017

Example:

PumpkinDB> ["key" 1 ASSOC COMMIT] WRITE.

PumpkinDB> ["key" 1 ASSOC COMMIT] WRITE.
Error: "Duplicate key" 0x0102 0x06

Philosophically speaking, if we try to overwrite key value with the same value, are we actually overwriting? Practically speaking, should this case result in an error, or should it silently execute, since there's no change?

@stuarth
Copy link
Member

stuarth commented Jun 28, 2017

I'm happy with the current behavior, but think either choice is defensible. Any particular use case motivating the question?

@yrashk
Copy link
Contributor Author

yrashk commented Jun 28, 2017

The use case motivating the question is simplifying some code where it'll be easier not to handle this error and avoid checking if the exact pair is already present.

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

2 participants