aquadoggo icon indicating copy to clipboard operation
aquadoggo copied to clipboard

`StorageProvider` methods [tracking]

Open sandreae opened this issue 2 years ago • 2 comments

We will be needing extra methods on StorageProvider as we move forward, let's collect them here to get an overview of how things might look. Also as we use it more, we may want to make changes.

Also general renaming, possibly following these conventions more closely: https://rust-lang.github.io/api-guidelines/naming.html#ad-hoc-conversions-follow-as_-to_-into_-conventions-c-conv

LogStore

  • [ ] rename: get to get_log or something else better.

EntryStore

OperationStore

  • [ ] add: get_operations_by_document_view_id(id: DocumentViewId) -> Result<Vec<Operation>> https://github.com/p2panda/aquadoggo/issues/148

DocumentStore

  • [x] rename: get_document_by_id to get_latest_view_for_document
  • [ ] add: get_document_by_id which returns the actual Document rather than the view.
  • [ ] add: get_document_id_by_view_id(document_view_id: DocumentViewId) -> Result<DocumentId>
  • [ ] add: get_document_by_view_id(view_id: DocumentViewId) -> Result<Document> (returns document with the given view inside, not the latest view)
  • [ ] change: get_documents_by_schema(schema: SchemaId) -> Result<Vec<Document>>
  • [ ] change: DocumentMeta.operations: Option<Vec<VerifiedOperation>>
  • [x] add: ~get_parents_with_pinned_relation(document_view_id: &DocumentViewId) -> Result<Vec<DocumentViewId>> https://github.com/p2panda/aquadoggo/pull/144~
  • [x] add: ~get_parents_with_unpinned_relation(document_view_id: &Documentd) -> Result<Vec<DocumentViewId>> https://github.com/p2panda/aquadoggo/pull/144~

SchemaStore

  • [ ] add: get_log_seq_for_schema(schema_id: SchemaId) -> Vec<(Author, Vec<(LogId, SeqNum)>>

StorageProvider

  • [x] move: any non-top level methods (think there is only one left) to their respective sub-store.

sandreae avatar Jun 10 '22 11:06 sandreae

Is this ready? ✨

adzialocha avatar Aug 24 '22 06:08 adzialocha

Unfortunately, no... Couldn't get round to making these changes yet.

sandreae avatar Aug 24 '22 07:08 sandreae