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

Secondary index composite key #196

Closed
wants to merge 13 commits into from
Closed

Conversation

ethanfrey
Copy link
Member

@ethanfrey ethanfrey commented Dec 21, 2020

From @maurolacy so I can comment

After discussion, this is either very difficult or impossible with current API and encoding schemes.
We may need to differentiate VarLength indexes and FixedLength indexes

Copy link
Member Author

@ethanfrey ethanfrey left a comment

Choose a reason for hiding this comment

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

First review on WIP

contracts/cw721-base/src/state.rs Outdated Show resolved Hide resolved
let mut store = MockStorage::new();
let mut map = build_map();

// save data
Copy link
Member Author

Choose a reason for hiding this comment

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

I would pull this out into a setup function as I see this in 3 tests or so.

packages/storage-plus/src/indexed_map.rs Outdated Show resolved Hide resolved
packages/storage-plus/src/indexed_map.rs Show resolved Hide resolved

/// MARKER is stored in the multi-index as value, but we only look at the key (which is pk)
const MARKER: u32 = 1;
// FIXME: Re-introduce this for MultiIndex
// const MARKER: bool = true;
Copy link
Member Author

Choose a reason for hiding this comment

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

Where did this go?
btw, I used 1u32 as it has the smallest json representation (1 vs true)

Copy link
Contributor

Choose a reason for hiding this comment

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

I did this to make prefix() work. prefix() returns Prefix<T>, so I needed the value type to match.

That said, this is just temporary, and towards a solution.

packages/storage-plus/src/indexes.rs Outdated Show resolved Hide resolved
packages/storage-plus/src/indexes.rs Show resolved Hide resolved
@ethanfrey ethanfrey added the blocked Waiting for something before we can start label Dec 21, 2020
@ethanfrey ethanfrey removed the blocked Waiting for something before we can start label Dec 22, 2020
@maurolacy
Copy link
Contributor

Closing in favour of #211.

@maurolacy maurolacy closed this Dec 28, 2020
@ethanfrey ethanfrey deleted the secondary-index-composite-key branch August 26, 2021 09:27
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.

2 participants