Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify error message wording #1438

Merged
merged 3 commits into from
Dec 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions persistent/Database/Persist/TH.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1185,13 +1185,14 @@ mkUnique mps entityMap entDef (UniqueDef constr _ fields attrs) =
lookup3 x rest

nullErrMsg =
mconcat [ "Error: By default we disallow NULLables in an uniqueness "
, "constraint. The semantics of how NULL interacts with those "
, "constraints is non-trivial: two NULL values are not "
, "considered equal for the purposes of an uniqueness "
, "constraint. If you understand this feature, it is possible "
, "to use it your advantage. *** Use a \"!force\" attribute "
, "on the end of the line that defines your uniqueness "
mconcat [ "Error: By default Persistent disallows NULLables in an uniqueness "
, "constraint. The semantics of how NULL interacts with those constraints "
, "is non-trivial: most SQL implementations will not consider two NULL "
, "values to be equal for the purposes of an uniqueness constraint, "
, "allowing insertion of more than one row with a NULL value for the "
, "column in question. If you understand this feature of SQL and still "
, "intend to add a uniqueness constraint here, *** Use a \"!force\" "
, "attribute on the end of the line that defines your uniqueness "
, "constraint in order to disable this check. ***" ]

-- | This function renders a Template Haskell 'Type' for an 'UnboundFieldDef'.
Expand Down