Skip to content

add a nested hashmap#24

Merged
ad-tra merged 7 commits into
masterfrom
lookup-map
Jan 26, 2026
Merged

add a nested hashmap#24
ad-tra merged 7 commits into
masterfrom
lookup-map

Conversation

@ad-tra

@ad-tra ad-tra commented Jan 18, 2026

Copy link
Copy Markdown
Member

HashMap<K1, HashMap<K2, V>>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new LookupMap<K1, K2, V> data structure to the db-rs library, implementing a nested HashMap pattern (HashMap<K1, HashMap<K2, V>>). This follows the established pattern of specialized lookup table types like LookupList and LookupSet.

Changes:

  • Adds LookupMap implementation with support for two-level key-value storage
  • Includes comprehensive tests covering insert, remove, create_key, and clear_key operations
  • Exports the new type in the library's public API

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.

File Description
db/src/lookup_map.rs Core implementation of LookupMap with Table trait, LogEntry enum, and public API methods
db/tests/lookup_map_tests.rs Test suite covering basic operations, persistence, and edge cases
db/src/lib.rs Module declaration and public export of LookupMap

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread db/tests/lookup_map_tests.rs
Comment thread db/tests/lookup_map_tests.rs Outdated
Comment thread db/tests/lookup_map_tests.rs Outdated
Comment thread db/tests/lookup_map_tests.rs Outdated
Comment thread db/tests/lookup_map_tests.rs
Comment thread db/tests/lookup_map_tests.rs
Comment thread db/tests/lookup_map_tests.rs
Comment thread db/tests/lookup_map_tests.rs

@Parth Parth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

copilot is right about the comment which says that the tests need to have unique directories and run in parallel.

I was lazy about it and didn't feel the need to introduce something like uuid to the deps, but consider making some "random" test function to fix the issue.

The code looks fine and the tests did pass, so I'll release this from your branch, but fix this before you merge it

@Parth

Parth commented Jan 20, 2026

Copy link
Copy Markdown
Member

415bce9 is released as 0.3.4

@ad-tra ad-tra merged commit f5a96fc into master Jan 26, 2026
1 check passed
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.

3 participants