v0.11.0
New Features
Secondary indexes.
It's now possible, when writing a record, to have it indexed by additional keys other than its primary key.
Example:
client.Put(ctx, "my-user-id", []byte(value), SecondaryIndex("name", "my-user-name"))
This will allow to do a List()
or RangeScan()
operation based on the secondary index, instead of the primary key:
resCh := client.RangeScan(ctx, "A", "M", UseIndex("name"))
list, err := client.List(ctx, "A", "M", UseIndex("name"))
The returned list will be a list of the primary keys that match the boundaries in the secondary index.
Notes:
- The secondary key is not required to be unique (unlike the primary key for the record)
- A single record can have more that 1 secondary index (eg: index by
name
,age
,location
...) - There can be multiple secondary keys for the same secondary index. eg:
client.Put(ctx, "my-user-id", []byte(value),
SecondaryIndex("ref", "my-ref-1"),
SecondaryIndex("ref", "my-ref-2"),
)
What's Changed
- feat(wal): support chained CRC for write ahead log by @mattisonchao in #538
- Force configmap ownership when updating by @merlimat in #540
- Protobuf changes for secondary indexes by @merlimat in #541
- feat(wal): Decoupled codec related logic by @mattisonchao in #542
- Secondary indexes implementation by @merlimat in #544
- Allow to pass the same secondary index name multiple times on the same record by @merlimat in #546
- Client API changes for secondary idx by @merlimat in #545
- feat(wal): support discard corrupted uncommitted data by @mattisonchao in #547
Full Changelog: v0.10.0...v0.11.0