Announcing Megadex - Removes boilerplate for multi-map style indexing of structs


Megadex is a simple tool that removes the boilerplate for indexing structs via multiple fields. Presently it uses rkv which uses lmdb. Though a purely in-mem version is planned.

For every struct field you annotate, it will create additional accessor methods and indexes, including atomic insert/delete/get operations. You can then fetch collections of your structs by matching a particular field.

When you derive(Megadex) you must supply at least an #[id] annotation on one of your fields that indicates that the field is the “primary key” of the struct. Ids must be “string-ish” and they are expected to be unique in the db.