Store
The rows of one model, read and written by the derived seven.
It lives in core because it is the one seam http and db have to meet at, and they are siblings that never see each other: db produces one of these from a Table[A], http consumes one in io.eezo.http.Resource, and the generated route table is the only place both names appear. A trait rather than a class, because two implementations exist and nobody writes a third by hand.
Its charter is the vocabulary the derivation can speak, not eezo's data-access API. Five operations, one per thing the seven routes do, and no sixth. A route that wants a filter, a sort or a page is a handwritten route using db's query DSL directly, and it never touches this trait. Widening it to serve one such route would put a second query language in the most expensive module in the build to change.
Nothing here throws. A missing row is a false or a None, which io.eezo.http.Resource turns into a 404; an implementation that raised would be deciding an HTTP status one layer below the layer that knows what HTTP is.
Type parameters
- A
-
the model, whose key is
Id[A]. Per model rather than one instance holding every model's rows: a store that needs telling which bucket to look in is a store that cannot be typed.
Attributes
- Source
- Store.scala
- Graph
-
- Supertypes
- Known subtypes
-
class Scoped[A]