Add type property to levelup and abstract-leveldown implementations
Closed this issue · 2 comments
A continuation of Level/subleveldown#34. cc @ralphtheninja
Background
Modules like subleveldown
and multileveldown
have to peel off layers (levelup
, deferred-leveldown
and/or encoding-down
) from an input db to get to the inner db, which they then rewrap with those same layers.
That process ain't pretty, so I wrote reachdown
to hide that ugliness. It currently has to feature-detect deferred-leveldown
and encoding-down
, and this may clash with another abstract-leveldown
implementation at some point. To counter that, we can add a type
property across the board:
MyLeveldown.prototype.type = 'my-leveldown'
Note: with that in place, the unwrapping (or even merely the fact that we have to unwrap) still isn't very clean, but IMO it's acceptable as a medium-term solution because there's a plan to merge level(up)
functionality into abstract-leveldown
(#58) which ultimately removes the need to unwrap.
Tasks
Add type
-
levelup
- PR or commit: Level/levelup#678
- Release: 4.3.0
-
deferred-leveldown
- PR or commit: Level/deferred-leveldown#75
- Release: 5.2.1
-
encoding-down
- PR or commit: Level/encoding-down@8a23848
- Release: 6.3.0
-
subleveldown
(already had it) -
multileveldown
- PR or commit: Level/multileveldown#15
-
Release: not ours
-
level-js
- PR or commit: Level/level-js#179
- Release: 5.0.0
-
(not needed now)leveldown
-
(not needed now)memdown
-
(not needed now)rocksdb
Use reachdown
utility
-
subleveldown
(reachdown
itself was adapted from code insubleveldown
)- PR or commit: Level/subleveldown#75
- Release: 4.1.3
-
multileveldown
- PR or commit: Level/multileveldown#15
-
Release: not ours
-
level-bench
- PR or commit: Level/bench@9f475d9
- Release: 0.1.0
-
level-test
(in its tests)- PR or commit: Level/level-test@8350402
- Release: pending
Awesome name reachdown
:)
Closing because the remaining items are external (multileveldown
) or tests-only (level-test
).