Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions persistent/Database/Persist/Class/PersistUnique.hs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ import Database.Persist.Types
class (PersistStoreRead backend) => PersistUniqueRead backend where
-- | Get a record by unique key, if available. Returns also the identifier.
--
-- If your unique key contains a nullable field, then, by default, getBy will not match if any of the fields are NULL.
--
-- === __Example usage__
--
-- With <#schema-persist-unique-1 schema-1> and <#dataset-persist-unique-1 dataset-1>:
Expand Down
3 changes: 2 additions & 1 deletion persistent/Database/Persist/TH/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1524,7 +1524,8 @@ mkUnique mps entityMap entDef (UniqueDef constr _ fields attrs) =
, "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. ***"
, "constraint in order to disable this check. ***\n"
, "By default, this means using `getBy`, `insertBy`, or anything that fetches by unique key will NOT match if any of the fields are NULL."
]

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