Skip to content

Commit

Permalink
Clarify error message wording (#1438)
Browse files Browse the repository at this point in the history
* Clarify error message wording

* d'oh

* escape quotes
  • Loading branch information
friedbrice committed Dec 2, 2022
1 parent 0831288 commit f7382d9
Showing 1 changed file with 8 additions and 7 deletions.
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

0 comments on commit f7382d9

Please sign in to comment.