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

QOL API methods #73

Closed
cswendrowski opened this issue Mar 21, 2023 · 4 comments
Closed

QOL API methods #73

cswendrowski opened this issue Mar 21, 2023 · 4 comments

Comments

@cswendrowski
Copy link
Contributor

While we're contributing, we were wondering if you had any interest in any of the following quality of life methods we've added to our wrapper for ClassicLevel:

  1. compactFull - Convenience function that discovers the first and last key and calls compactRange
  2. size - Convenience function that discovers the first and last key and calls approximateSize
  3. has - Definitely a feature that would be better if it existed upstream, but iterates keys until specified key is discovered (if at all)
@juliangruber
Copy link
Member

juliangruber commented Mar 21, 2023

I'm +-0 on the first two, as discovering first and last key is cheap, and it's convenient indeed. However it's also simple and infrequently desired enough that it could live in userland.

-1 to the third method, because it means a full table scan and in many scenarios where you need something like leveldb (have a lot of data) isn't actually what you want to do

@vweevers
Copy link
Member

vweevers commented Apr 7, 2023

Agree with @juliangruber on the first two.

Not sure I understand the third method. Can you give an example?

@juliangruber
Copy link
Member

I imagine it's something like https://github.com/juliangruber/level-exists/blob/master/index.js

@vweevers
Copy link
Member

vweevers commented Feb 3, 2024

Let's assume that's the case (shouldn't require iteration though). That's covered by Level/community#106 so I'll close this.

@vweevers vweevers closed this as not planned Won't fix, can't repro, duplicate, stale Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants