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

Add builtin sublevels ✨ #8

Merged
merged 5 commits into from
Jan 2, 2022
Merged

Add builtin sublevels ✨ #8

merged 5 commits into from
Jan 2, 2022

Commits on Jan 2, 2022

  1. Add builtin sublevels ✨

    Adds a `db.sublevel(name[, options]`) method that works the same as
    `subleveldown` except it returns an `abstract-level` database instead
    of a `levelup` database. Data-wise there's no change, so an
    `abstract-level` sublevel can read sublevels previously created with
    (and populated by) `subleveldown`.
    
    Uses code and tests from `subleveldown`. Where possible, I converted
    functional tests (against a `memdown` db) to unit tests (against a
    mocked database). The abstract test suite also repeats itself, to run
    both on a regular database, and a sublevel of the database.
    
    Comes with some new features compared to `subleveldown`:
    
    - `db.batch(..)` takes a `sublevel` option on operations, to atomically
      commit data to multiple sublevels
    - Sublevels support Uint8Array in addition to Buffer
    - `AbstractLevel#_sublevel()` can be overridden to add additional
      methods to sublevels.
    vweevers committed Jan 2, 2022
    Configuration menu
    Copy the full SHA
    8b842a5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3083e93 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6cfb6d3 View commit details
    Browse the repository at this point in the history
  4. Improve README.md and UPGRADING.md

    - Add links to modules
    - Replace references to `leveldown` (etc) with `classic-level` (etc)
    - Add more code examples
    - Document lack of constructor callback (compared to `levelup`)
    - Split encodings guide into consumers and implementors sections
    - Describe idempotent open in more detail
    - Describe passive open
    - Document that `open()` options must be accepted by constructor too
    - Describe `level@7` vs `level@8`.
    vweevers committed Jan 2, 2022
    Configuration menu
    Copy the full SHA
    c1f3230 View commit details
    Browse the repository at this point in the history
  5. Bump devDependencies

    vweevers committed Jan 2, 2022
    Configuration menu
    Copy the full SHA
    bb51886 View commit details
    Browse the repository at this point in the history