-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Implement destroy(), use global db store #23
Conversation
yeah yeah, tests are broken. I say we peg abstract-leveldown |
177c40c
to
b0681b3
Compare
rebased, mebbe it'll be green now |
while (db.keys.length) { | ||
delete db.store[toKey(db.keys.pop())] | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to delete it out of globalStore too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't need to, but might as well. otherwise an empty array/object hangs around.
Also, you forgot to comment on my semicolon :P
b0681b3
to
0c60946
Compare
updated |
0c60946
to
9b79588
Compare
Missed some more semicolons. When in Rome... |
NO SEMICOLONS WE ARE IN ROME AND THEY SHOOT SEMICOLONS IN ROME |
function getOrCreateDatabaseFromGlobal(name) { | ||
var key = toKey(name) | ||
, db = globalStore[key] | ||
if (!db) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace before this if
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also it doesn't need braces since it's trivial
fine by me with minor style tweaks |
sorry for the delay. de-Crockfordized the code and ready to push now |
Fixes #22.
There's now a global store that keeps track of all memdown databases, keyed by location. so if you do:
then both
db1
anddb2
will contain the same data.I also added a destroy test here, rather than in abstract-leveldown, because memdown isn't even passing the latest abstract-leveldown tests. If you want to see these tests pass at 100%, we're going to need to peg abstract-leveldown to v0.12.3 due to the snapshot test.