-
Notifications
You must be signed in to change notification settings - Fork 194
Closed
Labels
Description
If Keyv (and official storage adapters) were to expose more internals, this would allow for much richer functionality to be built on top of Keyv.
Mainly:
- Optionally return the raw DB object (Allow returning the raw DB object #39)
- Get all keys method (Expose Iterables #40)
- Delete multiple keys in a single operation (Delete multiple keys in a single operation #41)
- Get multiple keys in a single operation (Get multiple keys in a single operation #78)
- Check if key exists (.has() api method #50 )
Main thing that comes to mind is a DB migrator (needs access to expiry dates) and keyv-shrink which is currently a fork because the desired functionality couldn't be implemented on top of Keyv.
With the three listed options implemented, keyv-shrink could be implemented efficiently on top of Keyv. All updates to Keyv and Keyv storage adapters would automatically work with keyv-shrink. Example of an implementation could be something like this:
const Keyv = require('keyv');
class KeyvShrink extends Keyv {
shrink() {
...
}
}@MySidesTheyAreGone What are your thoughts on this? I'm tied up on client project right now but I'm interested in adding this soon.
Reactions are currently unavailable