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

[Feature]: Quad Collection #21061

Closed
oren-lava opened this issue Jul 24, 2024 · 4 comments · Fixed by #21090
Closed

[Feature]: Quad Collection #21061

oren-lava opened this issue Jul 24, 2024 · 4 comments · Fixed by #21090

Comments

@oren-lava
Copy link
Contributor

Summary

Implement a Quad collection to support collections with composite keys of four elements.

Problem Definition

Currently, the "collections" package supports composite keys of sizes 1-3. During development in the Lava project, I needed a collection with a composite key of 4 elements. This feature will provide extra flexibility for users of the "collections" package.

Proposed Feature

Implement a Quad collection to support collections with composite keys of four elements. It will be very similar to the Pair and Triple collections.

@tac0turtle
Copy link
Member

is the need for a quad collection in order to provides indexes for query based data?

@oren-lava
Copy link
Contributor Author

No. I wanted to create a new KV store using collections that will allow me to iterate over entries with a prefix of 3 elements, for performance purposes.

In the past (before the collections package existed), I've manually created KV stores that were encoded with custom bytes keys. Since the key was a bytes array, I could create a prefix of any length I wanted to.

Now, I wanted to use the collections package for its type-safety and elegance, but I was limited by the max size of composite keys - Triple.

@oren-lava
Copy link
Contributor Author

BTW, I've already implemented the Quad collection. Given your approval, I'll open a PR.

@testinginprod
Copy link
Contributor

@oren-lava feel free to open a PR, i'll be happy to review 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🥳 Done
Development

Successfully merging a pull request may close this issue.

3 participants