-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
849a417
commit e5ea9f6
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
defmodule Ecto.Adapters.SQL.Constraint do | ||
@moduledoc """ | ||
Specifies the constraint handling API | ||
""" | ||
|
||
@doc """ | ||
Receives the exception returned by `c:Ecto.Adapters.SQL.Connection.query/4`. | ||
The constraints are in the keyword list and must return the | ||
constraint type, like `:unique`, and the constraint name as | ||
a string, for example: | ||
[unique: "posts_title_index"] | ||
Must return an empty list if the error does not come | ||
from any constraint. | ||
""" | ||
@callback to_constraints(exception :: Exception.t(), options :: Keyword.t()) :: Keyword.t() | ||
end |