isEmbedded() expose what sort of contract the leveldown can provide.
See original GitHub issueAfter seeing a talk at nodeconf eu that used sqldown I realized it would be impossible to stop people using levelup with non-embedded back ends, and having a discussion of this https://github.com/rvagg/node-levelup/pull/255 scale every time would only turn me into a grumpy old bastard…
Then I realized there was a simpler possibility, we add an db.isEmbedded()
method this would be exposed on the levelup and leveldown instances, and modules that do not support non-embedded databases can throw with a helpful error message (that links to documentation on the distinction between embedded and service databases)
Also, there would be documentation on isEmbedded() and it would be easy to do a few pull requests to add isEmbedded to the various leveldowns. So it would be simpler than reimplementing all of level https://github.com/rvagg/node-levelup/issues/270 (this will take a long time, anyway) but still allow people using level in other ways, such as @nlf @adambrault @fritzy are doing.
Issue Analytics
- State:
- Created 9 years ago
- Comments:33 (30 by maintainers)
Top GitHub Comments
Though some differences between
memdown
,level-js
andleveldown
have since been fixed (with regards to snapshots and buffers), there are lots of interesting ideas here that relate to manifests, so ref: https://github.com/Level/subleveldown/issues/35 and https://github.com/Level/deferred-leveldown/issues/35.ah ok. agreed, this is good to know. thinking about future demands we could simplify by implementing a broader compatibility function, like:
etc