| Copyright | 2013-2017 Kei Hibino | 
|---|---|
| License | BSD3 | 
| Maintainer | ex8k.hibino@gmail.com | 
| Stability | experimental | 
| Portability | unknown | 
| Safe Haskell | None | 
| Language | Haskell2010 | 
Database.Relational.Record
Description
This module defines interfaces of projected record type.
Synopsis
- 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.
Instances
| (PersistableWidth a, HasProjection l a b) => IsLabel l (PI c a b) Source # | Derive  | 
| Defined in Database.Relational.OverloadedProjection | |
| ProductIsoFunctor (Record c) Source # | Map  | 
| Defined in Database.Relational.Record Methods (|$|) :: ProductConstructor (a -> b) => (a -> b) -> Record c a -> Record c b # | |
| ProductIsoApplicative (Record c) Source # | Compose  | 
| Defined in Database.Relational.Record | |
| ProjectableMaybe (Record c) Source # | |
| ProductIsoEmpty (Record c) () Source # | |
| TableDerivable r => Show (Record Flat r -> Assign r (PlaceHolders p)) Source # | Show Set clause and WHERE clause. | 
| TableDerivable r => Show (Record Flat r -> Restrict (PlaceHolders p)) Source # | Show WHERE clause. | 
| 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
Arguments
| :: PersistableWidth a | |
| => Record c a | Source  | 
| -> Pi a b | Record path | 
| -> Record c b | Narrower  | 
Trace projection path to get narrower Record.
Arguments
| :: 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  | 
| Methods (|$|) :: ProductConstructor (a -> b) => (a -> b) -> Record c a -> Record c b # | |
| ProductIsoApplicative (Record c) Source # | Compose  | 
| ProductIsoEmpty (Record c) () Source # | |