mara icon indicating copy to clipboard operation
mara copied to clipboard

Improve stores

Open radiac opened this issue 8 months ago • 0 comments

Stores are mostly stubs at the moment:

  • store and restore probably need to return/accept a constructor dict too
  • might be nice to lock keys to make it safer. or maybe just use a dataclass.

Serialisable store class

  • store() -> str - serialise to json, or to some unique ID
  • restore(str) - deserialise from json or unique ID

Top-level client.store - SessionStore:

  • dataclass-style. actually a dataclass?
  • do we want annotations and type hinting - pydantic?
  • or keep it simple for now, and just go with a dict

Needs to be extensible - user code needs to be able to add fields.

radiac avatar Jun 25 '24 00:06 radiac