skuld_repo
Ecto Repo integration for Skuld: effectful dispatch facade with InMemory, Ecto, and Stub handlers.
What's included
Skuld.Repo— effectful dispatch facade usingEffectfulFacadeSkuld.Repo.Effectful— effectful contract for standard Ecto Repo operationsSkuld.Repo.Ecto— production handler wrapping a real Ecto RepoSkuld.Repo.InMemory— closed-world in-memory store for testsSkuld.Repo.OpenInMemory— open-world in-memory store for testsSkuld.Repo.Stub— stateless stub for unit tests
Installation
def deps do
[
{:skuld_repo, "~> 0.32"}
]
end
Quick start
alias Skuld.Repo
comp do
user <- Repo.insert!(changeset)
found <- Repo.get(User, user.id)
{user, found}
end
|> Port.with_handler(%{Repo.Effectful => MyApp.Repo.Ecto})
|> Throw.with_handler()
|> Comp.run!()
See the architecture guide for how this fits into the Skuld ecosystem.