README – Altex.Repo View Source
A Repository for the "Altex Mix Projects".
Installation
Available in Hex, the package can be installed
by adding axrepo
to your list of dependencies in mix.exs
:
def deps do
[
{:axrepo, "~> 0.1"}
]
end
Usage
alias Altex.{Entity, Repo}
Repo.start_repo(:people)
{:ok, bob} = %{ name: "Bob", age: 57 }
|> Entity.init()
|> Repo.store(:people)
{:ok, ^bob} = Repo.load(:people, bob.id)
%{ bob | age: bob.age + 1 } |> Repo.store(:people)