This repository has been archived by the owner on Jul 24, 2022. It is now read-only.
Retun either {:ok, _} or :not_found when calling Repo.get(id) #50
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
twelve
Is your feature request related to a problem? Please describe.
At the moment, every time we ask for a model by id, we return turn the result of doing
Repo.get(id)
and this returns either a struct or nil. While this is fine, it is not so easy to pattern match in the caller code.Describe the solution you'd like
Return a tuple
{:ok, term()}
when the model is found. Return:not_found
when no such a row exists in the database.The text was updated successfully, but these errors were encountered: