#storage #back-end

oml-storage

A very simple wrapper to handle locked storage of items

19 releases (4 breaking)

0.5.4-alpha Feb 25, 2025
0.4.1-alpha Feb 19, 2025
0.4.0-alpha Jun 25, 2024
0.1.8-alpha Mar 19, 2024

#473 in Database interfaces

Download history 7/week @ 2024-11-13 1/week @ 2024-12-11 544/week @ 2025-02-19 290/week @ 2025-02-26

834 downloads per month

MIT license

72KB
1.5K SLoC

oml-storage

A very simple wrapper to handle locked storage of items.

Warning

This crate is still very much in flux, and things might change a lot.

We do use it in production for one of our games, so it should be good enough.

Examples

For Examples check oml-storage-examples.

Future

  • Considering merging this and the examples into a single workspace.
  • Considering adding an explicit StorageItemId trait, and include some default implementations.

Changes

0.5.0

0.4.1

  • Added lock_new, which will return AlreadyExists if the item already exists.
    • Only implemented for DiskStorage for now.

Breaking Changes

-> 0.5.0

  • Added StorageId trait!

0.2.x -> 0.3.x

metadata_highest_seen_id return OptionITEM::ID

metadata_highest_seen_id returns an OptionITEM::ID now, which will be None if we haven't seen any Id yet.

0.1.x -> 0.2.x

Replaced &str ID with ITEM::ID

  • You will need to implement make_id and generate_next_id for you Items!
  • Consider extra careful testing when using anything but String for ITEM::ID

Dependencies

~50MB
~855K SLoC