Skip to content

Remove start & end from range options #86

Closed

Description

@vweevers

I propose that we remove the start and end options from iterators & streams. Without doing a soft deprecation, because they were documented as legacy options 5 years ago. I prefer ripping off the band aid and throwing an error if start or end properties are present in options.

@Level/core Anyone opposed? Give a thumbs up or down. Keep reading for the motivation.


The start/end options are more surprising in reverse mode. While ltgte options fulfill the documented promise of "the returned entries are the same, but in reverse", start/end options must be swapped by the user to achieve that.

The relevant code to handle the whole set of options - which I think in many implementations has been built up through trial & error, putting trust in the extensive tests - is hard to follow, and hard to change.

In addition, there are rules of precedence between start/end and ltgte although a formal decision was never made (Level/abstract-leveldown#70) and tests don't cover it.

Activity

  1. added
    discussion
    semver-major
    on Oct 20, 2019
  2. juliangruber commented on Oct 20, 2019

    @juliangruber
    Member

    I would still favor a soft deprecation, so we don't surprise anyone, but if you want to go ahead and remove it right away that should work too I guess

  3. vweevers commented on Oct 20, 2019

    @vweevers
    MemberAuthor

    @juliangruber It'll be released as semver-major across the board, with the usual changelogs and upgrade guides. For the folks that missed both the 5-year-long documented notice and the upgrade guides, we'll throw an error. I think that's more than enough.

  4. ralphtheninja commented on Oct 20, 2019

    @ralphtheninja
    Member

    This will greatly simplify the leveldown C++ code.

  5. vweevers commented on Apr 9, 2021

    @vweevers
    MemberAuthor

    Work is tracked in #98.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionsemver-major

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions