Trash.Repo.get_kept_by-exclamation-mark
You're seeing just the function
get_kept_by-exclamation-mark
, go back to Trash.Repo module for more information.
Link to this function
get_kept_by!(queryable, clauses, opts \\ [], repo)
Specs
get_kept_by!( queryable :: Ecto.Queryable.t(), clauses :: Keyword.t() | map(), opts :: Keyword.t(), repo :: atom() ) :: Ecto.Schema.t()
Fetches a single kept result from the query.
Raises Ecto.MultipleResultsError
if more than one result. Raises
Ecto.NoResultsError
if no result was found.
Examples
iex> Trash.Repo.get_kept_by!(Post, title: "Hello World", [], MyApp.Repo)
%Post{title: "Hello World", discarded_at: %DateTime{}}
iex> Trash.Repo.get_kept_by!(Post, title: "Not Written", [], MyApp.Repo)
** (Ecto.NoResultsError)