Altex.Repo.Server (Altex.Repo v0.1.1) View Source
Each "table" has it's own Altex.Repo.Server
started from
Altex.Repo.start_repo/1
through the Altex.Repo.Supervisor
.
The repo will persist or not, based on the used gateway implementation.
The supervisor takes care to restart the server in case of failure and the server re-loads data from the gateway on init.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Return a list of all Altex.Entity
s of the given store
.
Load the Entity
with the given uuid
from the given store
.
Returns {:error, :not_found}
if the given uuid
doesn't exist
or {:ok, entity}
when found.
Start a repository server for the "table" store
.
Store the given entity
to the given store
. If an entity with the
same uuid
exists, it will be updated, otherwise a new entity will
be created.
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
Return a list of all Altex.Entity
s of the given store
.
Load the Entity
with the given uuid
from the given store
.
Returns {:error, :not_found}
if the given uuid
doesn't exist
or {:ok, entity}
when found.
Start a repository server for the "table" store
.
### Example:
iex> {:ok, pid} = __MODULE__.start_link(:people)
Store the given entity
to the given store
. If an entity with the
same uuid
exists, it will be updated, otherwise a new entity will
be created.
It returns {:ok, valid_entity}
or {:error, invalid_entity}
.