CosmWasm/cosmwasm-go

storage: multipart primary keys

Closed this issue · 2 comments

We need to also be capable of supporting objects in which multiple fields are primary keys.

Example:

type Balance struct {
    Address string <- primary key part 1
    Denom string <- primary key part 2
    Amount math.Uint128
}

It's not urgent as once indexing by fields is implemented this behaviour can be achieved (with a little of machinery - you need an intermediate object and to compose keys by yourself) without any extra code.

But we still should provide tooling to implement this effortlessly.

Nice helper, but maybe for 0.5.0 or later. I see #119 with single arg primary key as an essential feature. All the other ones are nice enhancements, and useful for more advanced cases, but shouldn't block progress on the basic functions.

ORM Moved to archway repo