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

feat(kv): add support for prefixed cursor search #16545

Merged
merged 3 commits into from
Jan 21, 2020
Merged

Conversation

GeorgeMac
Copy link
Contributor

@GeorgeMac GeorgeMac commented Jan 15, 2020

Closes #16534

This introduces the new CursorOption known as WithCursorPrefix(prefix).

This option configures the returned cursor to only return keys with the provided prefix.

When using ForwardCursor with this new option. The provided seek bytes must be prefixed with the provided prefix bytes, otherwise the forward cursor implementation should return kv.ErrSeekMissingPrefix error and a nil cursor.

  • CHANGELOG.md updated with a link to the PR (not the Issue)
  • Well-formatted commit messages
  • Rebased/mergeable
  • Tests pass
  • http/swagger.yml updated (if modified Go structs or API)
  • Documentation updated or issue created (provide link to issue/pr)
  • Signed CLA (if not already signed)

@GeorgeMac GeorgeMac marked this pull request as ready for review January 15, 2020 14:51
Copy link
Contributor

@stuartcarnie stuartcarnie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great improvement 💯

@GeorgeMac GeorgeMac merged commit 4f14cea into master Jan 21, 2020
@GeorgeMac GeorgeMac deleted the gm/kv-store-prefix branch January 21, 2020 12:52
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

Successfully merging this pull request may close these issues.

Implement kv.WithCursorPrefix(prefix) ForwardCursor Option
2 participants