-
Notifications
You must be signed in to change notification settings - Fork 353
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
Add Prefixer sub-prefixes support #214
Comments
First idea that comes to mind is to add a Advantages:
Disadvantages:
Variants / Improvements:
|
A possible alternative would be to use (abuse) tuples notation, using nesting for indicating the number of desired (sub-)prefixes. By example, Advantages:
Disadvantages:
|
@ethanfrey, what do you think? I can present a couple impls for this, and we can discuss them over the code if you like. By the way, this is required for the So, this is low priority, and more of a learning exercise for me / for the sake of completeness stuff at this point. |
Interesting issue. I am deep trying to get wasmd 0.14 out and our testnet updated. When I have time to look over all the prefix stuff, and open/merged PRs I can give real feedback. |
OK, I'll give the When you have some time, please take a look at #215, where I've implemented a variant of the first approach, above. |
Please don't work more on this now. I need to review like 4 PRs of yours first. |
Closed by #215 |
The current
Prefixer
trait has only aprefix()
method that returns a "full prefix", i. e., for a given compositePrimaryKey
, a prefix that is composed by all but the last element of the composite key.When ranging over composite keys, we would like to be able to select the keys that are part of the (fixed) prefix. That way, we can range over, by example, all the ages related to a fixed name. As there can be multiple names with the same age, we would typically use a
MultiIndex
, disambiguating entries by (unique) primary key, plus, using a prefix that fixes only the name. That second part (using a prefix for only the first element of the key, in a triple key) is currently unsupported.For some context, see #213, and #213 (comment) in particular.
Creating this issue to track possible implementations for this.
The text was updated successfully, but these errors were encountered: