Skip to content
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

detecting approximateSize presence #8

Closed
mcollina opened this issue Jul 2, 2013 · 6 comments
Closed

detecting approximateSize presence #8

mcollina opened this issue Jul 2, 2013 · 6 comments
Labels
enhancement New feature or request

Comments

@mcollina
Copy link
Member

mcollina commented Jul 2, 2013

approximateSize support is not widespread: MemDOWN and Level.js do not have it.

However, this interface do not provide a way for knowing if that support is there or not.

We need it for levelgraph/levelgraph#23.

@rvagg
Copy link
Member

rvagg commented Jul 3, 2013

So, I think we've deprecated db.approximateSize() in LevelUP in favour of db.db.approximateSize(), along with the other LevelDB-specific stuff. My preference would be to remove the tests from AbstractLevelDOWN and leave it to the back-end to decide whether to implement & expose it. Ultimately I'd like to see approximateSize gone from LevelUP, although we can leave the documentation telling how to access it with db.db.approximateSize().
Perhaps we should accelerate this for the next LevelUP release and then your feature-detection could just involve checking for db.db.approximateSize.

@Raynos
Copy link
Member

Raynos commented Jul 3, 2013

is db.db a thing? its that levelUpDbInstance.abstractLevelDownDbInstance ?

@rvagg
Copy link
Member

rvagg commented Jul 3, 2013

yeah, each LevelUP instance has a 'db' property that points to the underlying store, usually an instance of LevelDOWN but it'll be whatever was created when you pass in the 'db' property on init. The idea is to be able to expose store-specific functionality, like approximateSize() and probably createSnapshot(). LMDB would get something like createTransaction() perhaps, these things don't belong in LevelUP.

@mcollina
Copy link
Member Author

mcollina commented Jul 4, 2013

@rvagg I can't agree more with you that approximateSize should be gone from LevelUp, and just detecting if db.db.approximateSize exist is nice. Let me know how I can help you.

@vweevers
Copy link
Member

Ref Level/deferred-leveldown#35.

@vweevers vweevers added the enhancement New feature or request label Jan 1, 2019
@vweevers
Copy link
Member

Absorbing into Level/community#83.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants