Copyright | 2013-2017 Kei Hibino |
---|---|
License | BSD3 |
Maintainer | ex8k.hibino@gmail.com |
Stability | experimental |
Portability | unknown |
Safe Haskell | None |
Language | Haskell2010 |
This module defines interfaces of projected record type.
- data Record c t
- width :: Record c r -> Int
- columns :: Record c r -> [StringSQL]
- untype :: Record c r -> Tuple
- unsafeFromSqlTerms :: [StringSQL] -> Record c t
- unsafeFromQualifiedSubQuery :: Qualified SubQuery -> Record c t
- unsafeFromScalarSubQuery :: SubQuery -> Record c t
- unsafeFromTable :: Table r -> Record c r
- unsafeStringSql :: Record c r -> StringSQL
- pi :: PersistableWidth a => Record c a -> Pi a b -> Record c b
- piMaybe :: PersistableWidth a => Record c (Maybe a) -> Pi a b -> Record c (Maybe b)
- piMaybe' :: PersistableWidth a => Record c (Maybe a) -> Pi a (Maybe b) -> Record c (Maybe b)
- wpi :: PersistableRecordWidth a -> Record c a -> Pi a b -> Record c b
- flattenMaybe :: Record c (Maybe (Maybe a)) -> Record c (Maybe a)
- just :: Record c r -> Record c (Maybe r)
- unsafeToAggregated :: Record Flat r -> Record Aggregated r
- unsafeToFlat :: Record Aggregated r -> Record Flat r
- unsafeChangeContext :: Record c r -> Record c' r
- unsafeStringSqlNotNullMaybe :: HasColumnConstraint NotNull r => Record c (Maybe r) -> StringSQL
- data RecordList p t
- list :: [p t] -> RecordList p t
- unsafeListFromSubQuery :: SubQuery -> RecordList p t
- unsafeStringSqlList :: (p t -> StringSQL) -> RecordList p t -> StringSQL
Record data structure and interface
Phantom typed record. Projected into Haskell record type t
.
ProjectableMaybe (Record c) Source # | |
ProjectableShowSql (Record c) Source # | |
SqlContext c => SqlProjectable (Record c) Source # | Unsafely make |
Show (Record c t) Source # | |
Get column SQL string list of record.
unsafeFromSqlTerms :: [StringSQL] -> Record c t Source #
Unsafely generate Record
from SQL expression strings.
unsafeFromQualifiedSubQuery :: Qualified SubQuery -> Record c t Source #
Unsafely generate Record
from qualified (joined) sub-query.
unsafeFromScalarSubQuery :: SubQuery -> Record c t Source #
Unsafely generate Record
from scalar sub-query.
Projections
Trace projection path to get narrower Record
.
:: PersistableRecordWidth a | |
-> Record c a | Source |
-> Pi a b | Projection path |
-> Record c b | Narrower |
Trace projection path to get narrower Record
.
flattenMaybe :: Record c (Maybe (Maybe a)) -> Record c (Maybe a) Source #
Composite nested Maybe
on record phantom type.
unsafeToAggregated :: Record Flat r -> Record Aggregated r Source #
Unsafely lift to aggregated context.
unsafeToFlat :: Record Aggregated r -> Record Flat r Source #
Unsafely down to flat context.
unsafeChangeContext :: Record c r -> Record c' r Source #
Unsafely cast context type tag.
unsafeStringSqlNotNullMaybe :: HasColumnConstraint NotNull r => Record c (Maybe r) -> StringSQL Source #
Unsafely get SQL string expression of not null key record.
List of Record
data RecordList p t Source #
Projected record list type for row list.
list :: [p t] -> RecordList p t Source #
Make projected record list from Record
list.
unsafeListFromSubQuery :: SubQuery -> RecordList p t Source #
Make projected record list from SubQuery
.
unsafeStringSqlList :: (p t -> StringSQL) -> RecordList p t -> StringSQL Source #
Map record show operatoions and concatinate to single SQL expression.
Orphan instances
ProductIsoFunctor (Record c) Source # | Map |
ProductIsoApplicative (Record c) Source # | Compose |
ProductIsoEmpty (Record c) () Source # | |