groundhog-0.8.0.1: Type-safe datatype-database mapping library.

Safe HaskellNone
LanguageHaskell98

Database.Groundhog.Instances

Contents

Orphan instances

ToJSON PersistValue # 
FromJSON PersistValue # 
PrimitivePersistField Bool # 
PrimitivePersistField Double # 
PrimitivePersistField Int # 
PrimitivePersistField Int8 # 
PrimitivePersistField Int16 # 
PrimitivePersistField Int32 # 
PrimitivePersistField Int64 # 
PrimitivePersistField Word8 # 
PrimitivePersistField Word16 # 
PrimitivePersistField Word32 # 
PrimitivePersistField Word64 # 
PrimitivePersistField ByteString # 
PrimitivePersistField ByteString # 
PrimitivePersistField String # 
PrimitivePersistField Text # 
PrimitivePersistField UTCTime # 
PrimitivePersistField Text # 
PrimitivePersistField ZonedTime # 
PrimitivePersistField TimeOfDay # 
PrimitivePersistField Day # 
PurePersistField () # 
(PersistField a, PrimitivePersistField a) => PurePersistField a # 
(PersistField a, PrimitivePersistField a) => SinglePersistField a # 
PersistField Bool # 
PersistField Double # 
PersistField Int # 
PersistField Int8 # 
PersistField Int16 # 
PersistField Int32 # 
PersistField Int64 # 
PersistField Word8 # 
PersistField Word16 # 
PersistField Word32 # 
PersistField Word64 # 
PersistField () # 

Methods

persistName :: () -> String #

toPersistValues :: PersistBackend m => () -> m ([PersistValue] -> [PersistValue]) #

fromPersistValues :: PersistBackend m => [PersistValue] -> m ((), [PersistValue]) #

dbType :: DbDescriptor db => proxy db -> () -> DbType #

PersistField ByteString # 
PersistField ByteString # 
PersistField String # 
PersistField Text # 
PersistField UTCTime # 
PersistField Text # 
PersistField ZonedTime # 
PersistField TimeOfDay # 
PersistField Day # 
NeverNull Bool # 
NeverNull Double # 
NeverNull Int # 
NeverNull Int8 # 
NeverNull Int16 # 
NeverNull Int32 # 
NeverNull Int64 # 
NeverNull Word8 # 
NeverNull Word16 # 
NeverNull Word32 # 
NeverNull Word64 # 
NeverNull ByteString # 
NeverNull ByteString # 
NeverNull String # 
NeverNull Text # 
NeverNull UTCTime # 
NeverNull Text # 
NeverNull ZonedTime # 
NeverNull TimeOfDay # 
NeverNull Day # 
(PersistEntity v, EntityConstr' (IsSumType v) c) => EntityConstr v c # 

Methods

entityConstrNum :: proxy v -> c a -> Int #

(PrimitivePersistField a, NeverNull a) => PrimitivePersistField (Maybe a) # 
PersistField a => PersistField [a] # 

Methods

persistName :: [a] -> String #

toPersistValues :: PersistBackend m => [a] -> m ([PersistValue] -> [PersistValue]) #

fromPersistValues :: PersistBackend m => [PersistValue] -> m ([a], [PersistValue]) #

dbType :: DbDescriptor db => proxy db -> [a] -> DbType #

(PersistField a, NeverNull a) => PersistField (Maybe a) # 
(PersistEntity v, IsUniqueKey k, (~) * k (Key v (Unique u))) => FieldLike (u (UniqueMarker v)) k # 

Methods

fieldChain :: (DbDescriptor db, ProjectionDb (u (UniqueMarker v)) db) => proxy db -> u (UniqueMarker v) -> FieldChain #

(PersistEntity v, IsUniqueKey k, (~) * k (Key v (Unique u))) => Assignable (u (UniqueMarker v)) k # 
(PersistEntity v, IsUniqueKey k, (~) * k (Key v (Unique u))) => Projection (u (UniqueMarker v)) k # 
EntityConstr v c => Projection (c (ConstructorMarker v)) v # 
Show (Key v u) => ToJSON (Key v u) # 

Methods

toJSON :: Key v u -> Value #

toEncoding :: Key v u -> Encoding #

toJSONList :: [Key v u] -> Value #

toEncodingList :: [Key v u] -> Encoding #

Read (Key v u) => FromJSON (Key v u) # 

Methods

parseJSON :: Value -> Parser (Key v u) #

parseJSONList :: Value -> Parser [Key v u] #

(DbDescriptor db, PersistEntity v, PersistField v) => PrimitivePersistField (KeyForBackend db v) # 
(PurePersistField a, PurePersistField b) => PurePersistField (a, b) # 
(PersistField a, PersistField b) => PersistField (a, b) # 

Methods

persistName :: (a, b) -> String #

toPersistValues :: PersistBackend m => (a, b) -> m ([PersistValue] -> [PersistValue]) #

fromPersistValues :: PersistBackend m => [PersistValue] -> m ((a, b), [PersistValue]) #

dbType :: DbDescriptor db => proxy db -> (a, b) -> DbType #

(DbDescriptor db, PersistEntity v, PersistField v) => PersistField (KeyForBackend db v) # 
NeverNull (KeyForBackend db v) # 
PrimitivePersistField (Key v u) => NeverNull (Key v u) # 
(PersistField a', PersistField b') => Embedded (a', b') # 

Associated Types

data Selector (a', b') a :: * #

Methods

selectorNum :: Selector (a', b') a -> Int #

(EntityConstr v c, (~) * a (AutoKey v)) => FieldLike (AutoKeyField v c) a # 

Methods

fieldChain :: (DbDescriptor db, ProjectionDb (AutoKeyField v c) db) => proxy db -> AutoKeyField v c -> FieldChain #

(EntityConstr v c, (~) * a (AutoKey v)) => Assignable (AutoKeyField v c) a # 
(EntityConstr v c, (~) * a (AutoKey v)) => Projection (AutoKeyField v c) a # 
(~) * a Bool => Projection (Cond db r) a # 

Associated Types

type ProjectionDb (Cond db r) db :: Constraint #

type ProjectionRestriction (Cond db r) r :: Constraint #

Methods

projectionExprs :: (DbDescriptor db, ProjectionDb (Cond db r) db, ProjectionRestriction (Cond db r) r) => Cond db r -> [UntypedExpr db r] -> [UntypedExpr db r] #

projectionResult :: PersistBackend m => Cond db r -> [PersistValue] -> m (a, [PersistValue]) #

(Projection a1 a1', Projection a2 a2') => Projection (a1, a2) (a1', a2') # 

Associated Types

type ProjectionDb (a1, a2) db :: Constraint #

type ProjectionRestriction (a1, a2) r :: Constraint #

Methods

projectionExprs :: (DbDescriptor db, ProjectionDb (a1, a2) db, ProjectionRestriction (a1, a2) r) => (a1, a2) -> [UntypedExpr db r] -> [UntypedExpr db r] #

projectionResult :: PersistBackend m => (a1, a2) -> [PersistValue] -> m ((a1', a2'), [PersistValue]) #

(PurePersistField a, PurePersistField b, PurePersistField c) => PurePersistField (a, b, c) # 
(PersistField a, PersistField b, PersistField c) => PersistField (a, b, c) # 

Methods

persistName :: (a, b, c) -> String #

toPersistValues :: PersistBackend m => (a, b, c) -> m ([PersistValue] -> [PersistValue]) #

fromPersistValues :: PersistBackend m => [PersistValue] -> m ((a, b, c), [PersistValue]) #

dbType :: DbDescriptor db => proxy db -> (a, b, c) -> DbType #

(PersistField a', PersistField b', PersistField c') => Embedded (a', b', c') # 

Associated Types

data Selector (a', b', c') a :: * #

Methods

selectorNum :: Selector (a', b', c') a -> Int #

(EntityConstr v c, PersistField a) => FieldLike (Field v c a) a # 

Methods

fieldChain :: (DbDescriptor db, ProjectionDb (Field v c a) db) => proxy db -> Field v c a -> FieldChain #

(EntityConstr v c, PersistField a) => Assignable (Field v c a) a # 
PersistField a => Projection (Expr db r a) a # 

Associated Types

type ProjectionDb (Expr db r a) db :: Constraint #

type ProjectionRestriction (Expr db r a) r :: Constraint #

Methods

projectionExprs :: (DbDescriptor db, ProjectionDb (Expr db r a) db, ProjectionRestriction (Expr db r a) r) => Expr db r a -> [UntypedExpr db r] -> [UntypedExpr db r] #

projectionResult :: PersistBackend m => Expr db r a -> [PersistValue] -> m (a, [PersistValue]) #

(EntityConstr v c, PersistField a) => Projection (Field v c a) a # 

Associated Types

type ProjectionDb (Field v c a) db :: Constraint #

type ProjectionRestriction (Field v c a) r :: Constraint #

Methods

projectionExprs :: (DbDescriptor db, ProjectionDb (Field v c a) db, ProjectionRestriction (Field v c a) r) => Field v c a -> [UntypedExpr db r] -> [UntypedExpr db r] #

projectionResult :: PersistBackend m => Field v c a -> [PersistValue] -> m (a, [PersistValue]) #

(Projection a1 a1', Projection a2 a2', Projection a3 a3') => Projection (a1, a2, a3) (a1', a2', a3') # 

Associated Types

type ProjectionDb (a1, a2, a3) db :: Constraint #

type ProjectionRestriction (a1, a2, a3) r :: Constraint #

Methods

projectionExprs :: (DbDescriptor db, ProjectionDb (a1, a2, a3) db, ProjectionRestriction (a1, a2, a3) r) => (a1, a2, a3) -> [UntypedExpr db r] -> [UntypedExpr db r] #

projectionResult :: PersistBackend m => (a1, a2, a3) -> [PersistValue] -> m ((a1', a2', a3'), [PersistValue]) #

(PurePersistField a, PurePersistField b, PurePersistField c, PurePersistField d) => PurePersistField (a, b, c, d) # 

Methods

toPurePersistValues :: (a, b, c, d) -> [PersistValue] -> [PersistValue] #

fromPurePersistValues :: [PersistValue] -> ((a, b, c, d), [PersistValue]) #

(PersistField a, PersistField b, PersistField c, PersistField d) => PersistField (a, b, c, d) # 

Methods

persistName :: (a, b, c, d) -> String #

toPersistValues :: PersistBackend m => (a, b, c, d) -> m ([PersistValue] -> [PersistValue]) #

fromPersistValues :: PersistBackend m => [PersistValue] -> m ((a, b, c, d), [PersistValue]) #

dbType :: DbDescriptor db => proxy db -> (a, b, c, d) -> DbType #

(PersistField a', PersistField b', PersistField c', PersistField d') => Embedded (a', b', c', d') # 

Associated Types

data Selector (a', b', c', d') a :: * #

Methods

selectorNum :: Selector (a', b', c', d') a -> Int #

(EntityConstr v c, PersistField a) => FieldLike (SubField db v c a) a # 

Methods

fieldChain :: (DbDescriptor db, ProjectionDb (SubField db v c a) db) => proxy db -> SubField db v c a -> FieldChain #

(EntityConstr v c, PersistField a) => Assignable (SubField db v c a) a # 
(EntityConstr v c, PersistField a) => Projection (SubField db v c a) a # 

Associated Types

type ProjectionDb (SubField db v c a) db :: Constraint #

type ProjectionRestriction (SubField db v c a) r :: Constraint #

Methods

projectionExprs :: (DbDescriptor db, ProjectionDb (SubField db v c a) db, ProjectionRestriction (SubField db v c a) r) => SubField db v c a -> [UntypedExpr db r] -> [UntypedExpr db r] #

projectionResult :: PersistBackend m => SubField db v c a -> [PersistValue] -> m (a, [PersistValue]) #

(Projection a1 a1', Projection a2 a2', Projection a3 a3', Projection a4 a4') => Projection (a1, a2, a3, a4) (a1', a2', a3', a4') # 

Associated Types

type ProjectionDb (a1, a2, a3, a4) db :: Constraint #

type ProjectionRestriction (a1, a2, a3, a4) r :: Constraint #

Methods

projectionExprs :: (DbDescriptor db, ProjectionDb (a1, a2, a3, a4) db, ProjectionRestriction (a1, a2, a3, a4) r) => (a1, a2, a3, a4) -> [UntypedExpr db r] -> [UntypedExpr db r] #

projectionResult :: PersistBackend m => (a1, a2, a3, a4) -> [PersistValue] -> m ((a1', a2', a3', a4'), [PersistValue]) #

(PurePersistField a, PurePersistField b, PurePersistField c, PurePersistField d, PurePersistField e) => PurePersistField (a, b, c, d, e) # 

Methods

toPurePersistValues :: (a, b, c, d, e) -> [PersistValue] -> [PersistValue] #

fromPurePersistValues :: [PersistValue] -> ((a, b, c, d, e), [PersistValue]) #

(PersistField a, PersistField b, PersistField c, PersistField d, PersistField e) => PersistField (a, b, c, d, e) # 

Methods

persistName :: (a, b, c, d, e) -> String #

toPersistValues :: PersistBackend m => (a, b, c, d, e) -> m ([PersistValue] -> [PersistValue]) #

fromPersistValues :: PersistBackend m => [PersistValue] -> m ((a, b, c, d, e), [PersistValue]) #

dbType :: DbDescriptor db => proxy db -> (a, b, c, d, e) -> DbType #

(PersistField a', PersistField b', PersistField c', PersistField d', PersistField e') => Embedded (a', b', c', d', e') # 

Associated Types

data Selector (a', b', c', d', e') a :: * #

Methods

selectorNum :: Selector (a', b', c', d', e') a -> Int #

(Projection a1 a1', Projection a2 a2', Projection a3 a3', Projection a4 a4', Projection a5 a5') => Projection (a1, a2, a3, a4, a5) (a1', a2', a3', a4', a5') # 

Associated Types

type ProjectionDb (a1, a2, a3, a4, a5) db :: Constraint #

type ProjectionRestriction (a1, a2, a3, a4, a5) r :: Constraint #

Methods

projectionExprs :: (DbDescriptor db, ProjectionDb (a1, a2, a3, a4, a5) db, ProjectionRestriction (a1, a2, a3, a4, a5) r) => (a1, a2, a3, a4, a5) -> [UntypedExpr db r] -> [UntypedExpr db r] #

projectionResult :: PersistBackend m => (a1, a2, a3, a4, a5) -> [PersistValue] -> m ((a1', a2', a3', a4', a5'), [PersistValue]) #