Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class SafeToInsert a
Documentation
class SafeToInsert a #
A type class which is used to witness that a type is safe to insert into the database without providing a primary key.
The TemplateHaskell
function mkPersist
will generate instances of this
class for any entity that it works on. If the entity has a default primary
key, then it provides a regular instance. If the entity has a Primary
natural key, then this works fine. But if the entity has an Id
column with
no default=
, then this does a TypeError
and forces the user to use
insertKey
.
Since: persistent-2.14.0.0
Instances
(TypeError (EntityErrorMessage a) :: Constraint) => SafeToInsert (Entity a) | |
Defined in Database.Persist.Class.PersistEntity | |
(TypeError (FunctionErrorMessage a b) :: Constraint) => SafeToInsert (a -> b) | |
Defined in Database.Persist.Class.PersistEntity |