meilisearch / meilisearch/heed

Expose a safe low-level cursor API.

Open
#255 3 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
914
Forks
82
PR merge metrics
No merged PRs in 30d

Description

The LMDB cursor API is quite powerful; something similar should be exposed by heed. The RwIter API gets close, but is unsafe and does not handle seeking to arbitrary keys. The API should allow the following operations:

  • Seeking to an arbitrary key.
  • Seeking to the next/previous key-value pair.
  • Reading the current key/value (could be part of the seeking operations).
  • Inserting an arbitrary key-value pair (LMDB optimizes for cases where the key would end up close to where the cursor is currently pointing).

A full cursor API would also let us efficiently implement an API similar to HashMap::entry (see this comment).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing RwIter API and the linked HashMap::entry discussion to understand the intended cursor use cases. Define how a safe cursor should seek arbitrary keys, move between key-value pairs, read its current position, and insert entries near that position. Done means the API supports these operations without unsafe use by callers.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.