-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
add destroy method #24
Conversation
sounds reasonable. +1 |
👍 |
👎 for having |
the idea being to abstract the back end specific behavior it is easier for an instanced method to call a static one then the other way around, leveldown could do |
it'll also have to check open status before destroying, having it on the prototype will make the API consumer assume that it has control over the whole instance so it hast to act that way too. Any more votes on this? I'm still not convinced but will go with the flow if y'all think this is a good idea. |
I'm ok with a common way of destroying/removing a database. It benefits all |
wouldn't the destroyer need to know about the specific way the back end is implemented? the *down seems like the the right place for it because that is where the knowledge about the specifics of the backend is located. |
I think this is more a question of whether this should be a static method off the *down implementations (not necessarily something for abstract-leveldown to care about?) or a member of the *down implementation prototype. In LevelDB, the I can't think what this would look like for LMDB, I'm not sure it has a native MemDOWN is just a matter of GC, nothing concrete needed there except perhaps resetting the arrays and storage objects. Level.js is where this discussion originated, I have no idea what's required on that front or what makes sense from an implementation perspective. The biggest question for contributors here to answer is related to is this a good API?
|
Fwiw I just rmrf and I'm happy. Is there some advantage I'm not seeing? On Friday, March 21, 2014, Rod Vagg notifications@github.com wrote:
Paolo Fragomeni github.com/hij1nx |
@hij1nx it only deletes LevelDB files so if there's other cruft in there then it won't remove that and will leave the directory intact (otherwise the directory goes too) |
Ah, right! Maybe a use case could be where you have metadata On Friday, March 21, 2014, Rod Vagg notifications@github.com wrote:
Paolo Fragomeni github.com/hij1nx |
in the case of wrappers around other databases it may need to send a protocol message, etc, |
checking in on this, do we like it, do we think it needs improvement, is it being blocked by leveldown? |
I'm having difficulty forming a strong enough opinion about this! As suggested in Level/leveldown#97, I'm warming to the idea. |
ping now that Level/leveldown#97 is merged? |
ummmmmm maybe, anybody else? |
Yeah, 👍 |
I'm having difficulty pinpointing when and where the decision was made, but methods like IMO a more generic solution would be a method like Such a method would differ from @ralphtheninja I vote for closing this and #42 and to open a new issue for |
@vweevers SGTM! |
based on discussion at Level/level-js#29 a standardized destroy method on the prototype is a lot more portable then the current thing leveldown has on the constructor, especially as it's easy to call a constructor's destroy method from a prototype method then the other way around.