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

Introduce different write modes #64

Open
medikoo opened this issue Apr 6, 2016 · 0 comments
Open

Introduce different write modes #64

medikoo opened this issue Apr 6, 2016 · 0 comments
Assignees

Comments

@medikoo
Copy link
Owner

medikoo commented Apr 6, 2016

In first place it'll be great to have possibility to have write mode locked. So any unattended changes are rejected.

Then it might be good to have a method which will allow to proceed with updates in provided callback, e.g.:

database.write(function () {
  obj.foo = 'bar'; // change saved
  obj.delete('bar'); // change saved
});
obj.foo = 'foo'; // exception thrown

Above could also serve as transaction handler (see also #58 for notes on transactions handling)

Then it might be good to have two different write methods:

  1. Event records are created for all update attempts (even if property values didn't change). so e.g.:
  obj.foo = 'bar'; // event record created
  obj.foo = 'bar'; // event record created
  1. Only when property value is changed event record is created
  obj.foo = 'bar'; // event record created only if value was not 'bar' already
  obj.foo = 'bar'; // no event record created
@medikoo medikoo self-assigned this Apr 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant