persistent-mtl-0.5.1: Monad transformer for the persistent API
Safe HaskellSafe-Inferred
LanguageHaskell2010

Database.Persist.Monad.Internal.PersistentShim

Synopsis

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

Instances details
(TypeError (EntityErrorMessage a) :: Constraint) => SafeToInsert (Entity a) 
Instance details

Defined in Database.Persist.Class.PersistEntity

(TypeError (FunctionErrorMessage a b) :: Constraint) => SafeToInsert (a -> b) 
Instance details

Defined in Database.Persist.Class.PersistEntity