Comments (5)
Ooh. We can also add levelup
features like deferredOpen
to the manifest. That could make merging levelup
and abstract-leveldown
smoother. E.g. we can implement deferred open in abstract-leveldown
, have it declare supports.deferredOpen = true
, then in levelup
we'll do:
if (db.supports.deferredOpen) {
// Use directly
} else {
// Wrap with deferred-leveldown
}
from community.
Should manifests extend manifests from underlying downs? Note that underlying downs can be swapped at runtime.
Let's take db.clear()
as an example, and a few different db's.
level-party
db
It may or may not have db.clear()
depending on:
- Whether
db
is the leader (backed byleveldown
) or follower (backed by amultileveldown
client) - Whether
db
is open (it's underlying db may be wrapped indeferred-leveldown
) - Whether
db
is wrapped insubleveldown
(in which case, see below)
In this case, it must be level-party
that defines the (hardcoded) manifest, and can include clear
in the manifest if all its dependencies support it.
subleveldown
db
It may or may not have db.clear()
depending on:
- Whether its input db has
clear()
(if we refactorsubleveldown
to unwrap the db early on, in its constructor, then we have the necessary info) - Whether it depends on
"abstract-leveldown": "^6.0.2"
but doesn't implementclear
itself and therefor incorrectly deletes all entries of the input db (this is currently the case, and something that would be solved by a manifest)
Here as well, it must be subleveldown
that defines the manifest, with the added limitation that the manifest cannot be "static" - as in require('subleveldown').manifest
.
from community.
We can start off simple, with a manifest object that has boolean properties, where each property describes a known feature. We can later handle custom features.
That's a smaller scope than e.g. level-manifest
which describes methods of a db and their "type" (readable, writable, sync or async).
In other words, when our manifest lists a feature like { clear: true }
) it is assumed to mean that the db has a clear()
method with the "standard" function signature.
We can later extend the format into { clear: { whatever } }
.
So to be future-proof, I'll rephrase: we can start off with a manifest object has truthy properties.
from community.
In some cases, feature support depends on the runtime environment too. E.g. not all browsers support binary keys in
level-js
. Is that something we want to expose?
Yes, and we can. We already feature-detect binary keys so we can just put the result of that in the manifest.
from community.
Additional requirements can be discussed in https://github.com/Level/supports.
For overall progress, see #83.
from community.
Related Issues (20)
- Proposal: add map method to abstract-down HOT 4
- Add `db.getMany(keys)` across the board HOT 8
- Refactor encodings HOT 6
- `rocksdb`: to be ported from `leveldown` (after other recent PRs)
- Fix Typings on DefinitelyTyped HOT 7
- Proposal: Add `db.has(key)` and `db.hasMany(keys)` HOT 12
- Deprecate old modules
- Package level with electron HOT 2
- Redisdown: how to create new `level-` libs? HOT 1
- Replace Sauce Labs with Playwright HOT 3
- Tracking issue: implicit and explicit snapshots
- willing to help revive some databases with abstract-level api HOT 4
- rocks-level implementation HOT 6
- Switch to dependabot HOT 9
- Dump Buffer for TypedArrays (for compactness and efficiency) HOT 6
- Any interest in maintaining 'lmdb'? HOT 3
- Counting entries in a level database HOT 4
- leveldown to remote database HOT 1
- Maintenance round: drop legacy features & runtime environments HOT 1
- Move to GitHub Actions HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from community.