Copyright | (c) Ole Krüger 2016 |
---|---|
License | BSD3 |
Maintainer | Ole Krüger <ole@vprsm.de> |
Safe Haskell | None |
Language | Haskell2010 |
- class KnownNat (Width a) => Entity a where
- embedEntity :: Entity e => e -> QueryGenerator a
- param0 :: Entity r => QueryGenerator (Tuple (r ': ts))
- param1 :: Entity r => QueryGenerator (Tuple (t0 ': (r ': ts)))
- param2 :: Entity r => QueryGenerator (Tuple (t0 ': (t1 ': (r ': ts))))
- param3 :: Entity r => QueryGenerator (Tuple (t0 ': (t1 ': (t2 ': (r ': ts)))))
- param4 :: Entity r => QueryGenerator (Tuple (t0 ': (t1 ': (t2 ': (t3 ': (r ': ts))))))
- param5 :: Entity r => QueryGenerator (Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (r ': ts)))))))
- param6 :: Entity r => QueryGenerator (Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (t5 ': (r ': ts))))))))
- param7 :: Entity r => QueryGenerator (Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (t5 ': (t6 ': (r ': ts)))))))))
- param8 :: Entity r => QueryGenerator (Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (t5 ': (t6 ': (t7 ': (r ': ts))))))))))
- param9 :: Entity r => QueryGenerator (Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (t5 ': (t6 ': (t7 ': (t8 ': (r ': ts)))))))))))
- genGeneric :: (Generic a, GEntity (Rep a)) => QueryGenerator a
- parseGeneric :: (Generic a, GEntity (Rep a)) => RowParser (GEntityWidth (Rep a)) a
- class KnownNat (GRecordWidth rec) => GEntityRecord rec where
- type GRecordWidth rec :: Nat
- class KnownNat (GEntityWidth dat) => GEntity dat where
- type GEntityWidth dat :: Nat
- type GenericEntity a = (Generic a, GEntity (Rep a))
Result and query entity
class KnownNat (Width a) => Entity a where Source #
An entity that is used as a parameter or result of a query.
genEntity :: QueryGenerator a Source #
Embed the entity into the query.
genEntity :: (Generic a, GEntity (Rep a)) => QueryGenerator a Source #
Embed the entity into the query.
parseEntity :: RowParser (Width a) a Source #
Retrieve an instance of a
from the result set.
parseEntity :: (Generic a, GEntity (Rep a), Width a ~ GEntityWidth (Rep a)) => RowParser (Width a) a Source #
Retrieve an instance of a
from the result set.
Entity Bool Source # | boolean |
Entity Double Source # | Any floating-point number |
Entity Float Source # | Any floating-point number |
Entity Int Source # | Any integer |
Entity Int8 Source # | Any integer |
Entity Int16 Source # | Any integer |
Entity Int32 Source # | Any integer |
Entity Int64 Source # | Any integer |
Entity Integer Source # | Any integer |
Entity Word Source # | Any unsigned integer |
Entity Word8 Source # | Any unsigned integer |
Entity Word16 Source # | Any unsigned integer |
Entity Word32 Source # | Any unsigned integer |
Entity Word64 Source # | Any unsigned integer |
Entity ByteString Source # |
|
Entity ByteString Source # |
|
Entity Scientific Source # | Any numeric type |
Entity String Source # |
|
Entity Text Source # |
|
Entity Value Source # |
|
Entity Text Source # |
|
Entity Natural Source # | Any unsigned integer |
Entity a => Entity (Maybe a) Source # | A value which may be |
GenericEntity (a, b) => Entity (a, b) Source # | Chain of 2 entities |
GenericEntity (a, b, c) => Entity (a, b, c) Source # | Chain of 3 entities |
GenericEntity (a, b, c, d) => Entity (a, b, c, d) Source # | Chain of 4 entities |
GenericEntity (a, b, c, d, e) => Entity (a, b, c, d, e) Source # | Chain of 5 entities |
GenericEntity (a, b, c, d, e, f) => Entity (a, b, c, d, e, f) Source # | Chain of 6 entities |
GenericEntity (a, b, c, d, e, f, g) => Entity (a, b, c, d, e, f, g) Source # | Chain of 7 entities |
embedEntity :: Entity e => e -> QueryGenerator a Source #
Embed an entity into the query.
param2 :: Entity r => QueryGenerator (Tuple (t0 ': (t1 ': (r ': ts)))) Source #
Parameter entity at index 2
param3 :: Entity r => QueryGenerator (Tuple (t0 ': (t1 ': (t2 ': (r ': ts))))) Source #
Parameter entity at index 3
param4 :: Entity r => QueryGenerator (Tuple (t0 ': (t1 ': (t2 ': (t3 ': (r ': ts)))))) Source #
Parameter entity at index 4
param5 :: Entity r => QueryGenerator (Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (r ': ts))))))) Source #
Parameter entity at index 5
param6 :: Entity r => QueryGenerator (Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (t5 ': (r ': ts)))))))) Source #
Parameter entity at index 6
param7 :: Entity r => QueryGenerator (Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (t5 ': (t6 ': (r ': ts))))))))) Source #
Parameter entity at index 7
param8 :: Entity r => QueryGenerator (Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (t5 ': (t6 ': (t7 ': (r ': ts)))))))))) Source #
Parameter entity at index 8
param9 :: Entity r => QueryGenerator (Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (t5 ': (t6 ': (t7 ': (t8 ': (r ': ts))))))))))) Source #
Parameter entity at index 9
genGeneric :: (Generic a, GEntity (Rep a)) => QueryGenerator a Source #
Generic QueryGenerator
for an entity.
parseGeneric :: (Generic a, GEntity (Rep a)) => RowParser (GEntityWidth (Rep a)) a Source #
Generic RowParser
for an entity.
Helpers
class KnownNat (GRecordWidth rec) => GEntityRecord rec where Source #
Generic record entity
type GRecordWidth rec :: Nat Source #
gEmbedRecord :: QueryGenerator (Record rec) Source #
gParseRecord :: RowParser (GRecordWidth rec) (Record rec) Source #
(GEntityRecord lhs, GEntityRecord rhs, KnownNat ((+) (GRecordWidth lhs) (GRecordWidth rhs))) => GEntityRecord (TCombine lhs rhs) Source # | |
Entity typ => GEntityRecord (TSingle meta typ) Source # | |
class KnownNat (GEntityWidth dat) => GEntity dat where Source #
Generic entity
type GEntityWidth dat :: Nat Source #
gEmbedEntity :: QueryGenerator (DataType dat) Source #
gParseEntity :: RowParser (GEntityWidth dat) (DataType dat) Source #
type GenericEntity a = (Generic a, GEntity (Rep a)) Source #
This is required if you want to use the default implementations of genEntity
or parseEntity
with polymorphic data types.