Copyright | 2019 Kei Hibino |
---|---|
License | BSD3 |
Maintainer | ex8k.hibino@gmail.com |
Stability | experimental |
Portability | unknown |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This module provides custom APIs with appropriate configuration for IBMDB2.
Synopsis
- data Unique
- data NotNull
- data Primary
- derivedUniqueRelation :: TableDerivable r => Key Unique r k -> Record c k -> UniqueRelation () c r
- primaryUpdate :: HasConstraintKey Primary r p => Table r -> KeyUpdate p r
- updateByConstraintKey :: Table r -> Key c r p -> KeyUpdate p r
- updateValuesWithKey :: ToSql q r => Pi r p -> r -> [q]
- primary :: HasConstraintKey Primary a p => Relation () a -> Relation p a
- primarySelect :: HasConstraintKey Primary a p => Relation () a -> Relation p a
- primary' :: PersistableWidth p => Key Primary a p -> Relation () a -> Relation p a
- unique :: PersistableWidth p => Key Unique a p -> Relation () a -> Relation p a
- uniqueSelect :: PersistableWidth p => Key Unique a p -> Relation () a -> Relation p a
- specifiedKey :: PersistableWidth p => Pi a p -> Relation () a -> Relation p a
- updateNumber :: (PersistableWidth s, Integral i, LiteralSQL i) => i -> Sequence s i -> Update ()
- updateNumber' :: (PersistableWidth s, Integral i, LiteralSQL i) => Config -> i -> Sequence s i -> Update ()
- ($$) :: Binding r s i => (i -> r) -> Number r i -> r
- ($$!) :: (i -> r) -> Number r i -> r
- extractNumber :: Number r i -> i
- unsafeSpecifyNumber :: Binding r s i => i -> Number r i
- fromRelation :: Binding r s i => Relation () r -> Sequence s i
- primaryBinding :: (TableDerivable r, SequenceDerivable s i, HasConstraintKey Primary r i) => SeqBinding r s i
- unsafeSpecifyBinding :: (TableDerivable r, SequenceDerivable s i) => Pi r i -> SeqBinding r s i
- seqRelation :: TableDerivable s => Sequence s i -> Relation () s
- unsafeSpecifySequence :: TableDerivable s => (s -> i) -> Pi s i -> Sequence s i
- data Sequence s i
- class TableDerivable s => SequenceDerivable s i | s -> i where
- derivedSequence :: Sequence s i
- data SeqBinding r s i
- class (TableDerivable r, SequenceDerivable s i) => Binding r s i | r -> s where
- binding :: SeqBinding r s i
- data Number r i
- derivedDelete :: TableDerivable r => (Record Flat r -> Restrict (PlaceHolders p)) -> Delete p
- derivedDelete' :: TableDerivable r => Config -> (Record Flat r -> Restrict (PlaceHolders p)) -> Delete p
- delete' :: TableDerivable r => Config -> (Record Flat r -> Restrict (PlaceHolders p)) -> Delete p
- typedDelete :: Table r -> (Record Flat r -> Restrict (PlaceHolders p)) -> Delete p
- typedDelete' :: Config -> Table r -> (Record Flat r -> Restrict (PlaceHolders p)) -> Delete p
- deleteSQL :: Config -> Table r -> (Record Flat r -> Restrict (PlaceHolders p)) -> String
- derivedInsertQuery :: TableDerivable r => Pi r r' -> Relation p r' -> InsertQuery p
- insertQuery' :: TableDerivable r => Config -> Pi r r' -> Relation p r' -> InsertQuery p
- typedInsertQuery :: Table r -> Pi r r' -> Relation p r' -> InsertQuery p
- typedInsertQuery' :: Config -> Table r -> Pi r r' -> Relation p r' -> InsertQuery p
- insertQuerySQL :: Config -> Table r -> Pi r r' -> Relation p r' -> String
- insertValueList :: (TableDerivable r, LiteralSQL r') => Pi r r' -> [r'] -> [Insert ()]
- insertValueList' :: (TableDerivable r, LiteralSQL r') => Config -> Pi r r' -> [r'] -> [Insert ()]
- derivedInsertValue :: TableDerivable r => Register r (PlaceHolders p) -> Insert p
- derivedInsertValue' :: TableDerivable r => Config -> Register r (PlaceHolders p) -> Insert p
- insertValue' :: TableDerivable r => Config -> Register r (PlaceHolders p) -> Insert p
- typedInsertValue :: Table r -> InsertTarget p r -> Insert p
- typedInsertValue' :: Config -> Table r -> InsertTarget p r -> Insert p
- derivedInsert :: (PersistableWidth r, TableDerivable r) => Pi r r' -> Insert r'
- insert :: (PersistableWidth r, TableDerivable r) => Pi r r' -> Insert r'
- typedInsert :: PersistableWidth r => Table r -> Pi r r' -> Insert r'
- typedInsert' :: PersistableWidth r => Config -> Table r -> Pi r r' -> Insert r'
- unsafeTypedInsert' :: String -> String -> Int -> Insert a
- chunkSizeOfInsert :: Insert a -> Int
- untypeChunkInsert :: Insert a -> String
- derivedUpdateAllColumn :: (PersistableWidth r, TableDerivable r) => (Record Flat r -> Restrict (PlaceHolders p)) -> Update (r, p)
- updateAllColumnNoPH :: (PersistableWidth r, TableDerivable r) => (Record Flat r -> Restrict ()) -> Update r
- updateAllColumn :: (PersistableWidth r, TableDerivable r) => (Record Flat r -> Restrict (PlaceHolders p)) -> Update (r, p)
- derivedUpdateAllColumn' :: (PersistableWidth r, TableDerivable r) => Config -> (Record Flat r -> Restrict (PlaceHolders p)) -> Update (r, p)
- updateAllColumn' :: (PersistableWidth r, TableDerivable r) => Config -> (Record Flat r -> Restrict (PlaceHolders p)) -> Update (r, p)
- typedUpdateAllColumn :: PersistableWidth r => Table r -> (Record Flat r -> Restrict (PlaceHolders p)) -> Update (r, p)
- derivedUpdate :: TableDerivable r => (Record Flat r -> Assign r (PlaceHolders p)) -> Update p
- derivedUpdate' :: TableDerivable r => Config -> (Record Flat r -> Assign r (PlaceHolders p)) -> Update p
- update' :: TableDerivable r => Config -> (Record Flat r -> Assign r (PlaceHolders p)) -> Update p
- typedUpdate :: Table r -> (Record Flat r -> Assign r (PlaceHolders p)) -> Update p
- typedUpdate' :: Config -> Table r -> (Record Flat r -> Assign r (PlaceHolders p)) -> Update p
- updateSQL :: Config -> Table r -> (Record Flat r -> Assign r (PlaceHolders p)) -> String
- unsafeTypedUpdate :: String -> Update p
- derivedKeyUpdate :: TableDerivable r => Pi r p -> KeyUpdate p r
- keyUpdate :: TableDerivable r => Pi r p -> KeyUpdate p r
- typedKeyUpdateTable :: TableDerivable r => Relation () r -> Pi r p -> KeyUpdate p r
- typedKeyUpdate :: Table a -> Pi a p -> KeyUpdate p a
- relationalQuery' :: Relation p r -> QuerySuffix -> Query p r
- relationalQuery_ :: Config -> Relation p r -> QuerySuffix -> Query p r
- relationalQuerySQL :: Config -> Relation p r -> QuerySuffix -> String
- unsafeTypedQuery :: String -> Query p a
- newtype Query p a = Query {}
- data KeyUpdate p a = KeyUpdate {
- updateKey :: Pi a p
- untypeKeyUpdate :: String
- newtype Update p = Update {}
- data Insert a = Insert {
- untypeInsert :: String
- chunkedInsert :: Maybe (String, Int)
- newtype InsertQuery p = InsertQuery {}
- newtype Delete p = Delete {}
- class UntypeableNoFetch (s :: Type -> Type) where
- untypeNoFetch :: s p -> String
- sqlChunksFromRecordList :: LiteralSQL r' => Config -> Table r -> Pi r r' -> [r'] -> [StringSQL]
- sqlFromInsertTarget :: Config -> Table r -> InsertTarget p r -> StringSQL
- sqlChunkFromInsertTarget :: Config -> Table r -> InsertTarget p r -> (StringSQL, Int)
- piRegister :: PersistableWidth r => Pi r r' -> Register r (PlaceHolders r')
- insertTarget' :: Register r (PlaceHolders p) -> InsertTarget p r
- insertTarget :: Register r () -> InsertTarget () r
- sqlFromUpdateTarget :: Config -> Table r -> (Record Flat r -> Assign r (PlaceHolders p)) -> StringSQL
- updateTargetAllColumn' :: PersistableWidth r => (Record Flat r -> Restrict (PlaceHolders p)) -> Record Flat r -> Assign r (PlaceHolders (r, p))
- updateTargetAllColumn :: PersistableWidth r => (Record Flat r -> Restrict ()) -> Record Flat r -> Assign r (PlaceHolders r)
- liftTargetAllColumn' :: PersistableWidth r => (Record Flat r -> Restrict (PlaceHolders p)) -> Record Flat r -> Assign r (PlaceHolders (r, p))
- liftTargetAllColumn :: PersistableWidth r => (Record Flat r -> Restrict (PlaceHolders ())) -> Record Flat r -> Assign r (PlaceHolders r)
- updateTarget' :: (Record Flat r -> Assign r (PlaceHolders p)) -> UpdateTarget p r
- updateTarget :: (Record Flat r -> Assign r ()) -> UpdateTarget () r
- sqlWhereFromRestriction :: Config -> Table r -> (Record Flat r -> Restrict (PlaceHolders p)) -> StringSQL
- restriction' :: (Record Flat r -> Restrict (PlaceHolders p)) -> Restriction p r
- restriction :: (Record Flat r -> Restrict ()) -> Restriction () r
- type Restriction p r = Record Flat r -> Restrict (PlaceHolders p)
- type UpdateTarget p r = Record Flat r -> Assign r (PlaceHolders p)
- data InsertTarget p r
- intersectAll' :: Relation p a -> Relation q a -> Relation (p, q) a
- intersect' :: Relation p a -> Relation q a -> Relation (p, q) a
- exceptAll' :: Relation p a -> Relation q a -> Relation (p, q) a
- except' :: Relation p a -> Relation q a -> Relation (p, q) a
- unionAll' :: Relation p a -> Relation q a -> Relation (p, q) a
- union' :: Relation p a -> Relation q a -> Relation (p, q) a
- intersectAll :: Relation () a -> Relation () a -> Relation () a
- intersect :: Relation () a -> Relation () a -> Relation () a
- exceptAll :: Relation () a -> Relation () a -> Relation () a
- except :: Relation () a -> Relation () a -> Relation () a
- unionAll :: Relation () a -> Relation () a -> Relation () a
- union :: Relation () a -> Relation () a -> Relation () a
- on' :: ([JoinRestriction a b] -> Relation pc (a, b)) -> [JoinRestriction a b] -> Relation pc (a, b)
- full :: Relation () a -> Relation () b -> [JoinRestriction (Maybe a) (Maybe b)] -> Relation () (Maybe a, Maybe b)
- right :: Relation () a -> Relation () b -> [JoinRestriction (Maybe a) b] -> Relation () (Maybe a, b)
- left :: Relation () a -> Relation () b -> [JoinRestriction a (Maybe b)] -> Relation () (a, Maybe b)
- inner :: Relation () a -> Relation () b -> [JoinRestriction a b] -> Relation () (a, b)
- full' :: Relation pa a -> Relation pb b -> [JoinRestriction (Maybe a) (Maybe b)] -> Relation (pa, pb) (Maybe a, Maybe b)
- right' :: Relation pa a -> Relation pb b -> [JoinRestriction (Maybe a) b] -> Relation (pa, pb) (Maybe a, b)
- left' :: Relation pa a -> Relation pb b -> [JoinRestriction a (Maybe b)] -> Relation (pa, pb) (a, Maybe b)
- inner' :: Relation pa a -> Relation pb b -> [JoinRestriction a b] -> Relation (pa, pb) (a, b)
- type JoinRestriction a b = Record Flat a -> Record Flat b -> Predicate Flat
- queryScalar :: (MonadQualify ConfigureQuery m, ScalarDegree r) => UniqueRelation () c r -> m (Record c (Maybe r))
- queryScalar' :: (MonadQualify ConfigureQuery m, ScalarDegree r) => UniqueRelation p c r -> m (PlaceHolders p, Record c (Maybe r))
- aggregatedUnique :: Relation ph r -> Pi r a -> (Record Flat a -> Record Aggregated b) -> UniqueRelation ph Flat b
- uniqueRelation' :: QueryUnique (PlaceHolders p, Record c r) -> UniqueRelation p c r
- uniqueQueryMaybe' :: UniqueRelation p c r -> QueryUnique (PlaceHolders p, Record c (Maybe r))
- uniqueQuery' :: UniqueRelation p c r -> QueryUnique (PlaceHolders p, Record c r)
- unUnique :: UniqueRelation p c r -> Relation p r
- unsafeUnique :: Relation p r -> UniqueRelation p c r
- aggregateRelation :: QueryAggregate (Record Aggregated r) -> Relation () r
- aggregateRelation' :: AggregatedQuery p r -> Relation p r
- relation :: QuerySimple (Record Flat r) -> Relation () r
- relation' :: SimpleQuery p r -> Relation p r
- queryList :: MonadQualify ConfigureQuery m => Relation () r -> m (RecordList (Record c) r)
- queryList' :: MonadQualify ConfigureQuery m => Relation p r -> m (PlaceHolders p, RecordList (Record c) r)
- queryMaybe :: (MonadQualify ConfigureQuery m, MonadQuery m) => Relation () r -> m (Record Flat (Maybe r))
- query :: (MonadQualify ConfigureQuery m, MonadQuery m) => Relation () r -> m (Record Flat r)
- tableOf :: TableDerivable r => Relation () r -> Table r
- derivedRelation :: TableDerivable r => Relation () r
- table :: Table r -> Relation () r
- data UniqueRelation p c r
- over :: SqlContext c => Record OverWindow a -> Window c () -> Record c a
- type QueryAggregate = Orderings Aggregated (Restrictings Aggregated (AggregatingSetT QueryCore))
- type AggregatedQuery p r = OrderedQuery Aggregated (Restrictings Aggregated (AggregatingSetT QueryCore)) p r
- type Window c = Orderings c (PartitioningSet c)
- groupingSets :: AggregatingSetList a -> AggregateKey a
- cube :: AggregatingPowerSet a -> AggregateKey a
- rollup :: AggregatingPowerSet a -> AggregateKey a
- bkey :: Record Flat r -> AggregatingPowerSet (Record Aggregated (Maybe r))
- set :: AggregatingSet a -> AggregatingSetList a
- key' :: AggregateKey a -> AggregatingSet a
- key :: Record Flat r -> AggregatingSet (Record Aggregated (Maybe r))
- type Assign r = Assignings r Restrict
- type Register r = Assignings r ConfigureQuery
- (<-#) :: forall (m :: Type -> Type) r v. Monad m => AssignTarget r v -> Record Flat v -> Assignings r m ()
- assignTo :: forall (m :: Type -> Type) v r. Monad m => Record Flat v -> AssignTarget r v -> Assignings r m ()
- type QuerySimple = Orderings Flat QueryCore
- type SimpleQuery p r = OrderedQuery Flat QueryCore p r
- data QueryUnique a
- extractCore :: QueryCore a -> ConfigureQuery (((a, [Predicate Flat]), JoinProduct), Duplication)
- type QueryCore = Restrictings Flat (QueryJoin ConfigureQuery)
- type OrderedQuery c (m :: Type -> Type) p r = Orderings c m (PlaceHolders p, Record c r)
- desc :: forall (m :: Type -> Type) c t. Monad m => Record c t -> Orderings c m ()
- asc :: forall (m :: Type -> Type) c t. Monad m => Record c t -> Orderings c m ()
- orderBy :: forall (m :: Type -> Type) c t. Monad m => Record c t -> Order -> Orderings c m ()
- orderBy' :: forall (m :: Type -> Type) c t. Monad m => Record c t -> Order -> Nulls -> Orderings c m ()
- data Orderings c (m :: Type -> Type) a
- type Restrict = Restrictings Flat ConfigureQuery
- having :: MonadRestrict Aggregated m => Predicate Aggregated -> m ()
- wheres :: MonadRestrict Flat m => Predicate Flat -> m ()
- on :: MonadQuery m => Predicate Flat -> m ()
- distinct :: MonadQuery m => m ()
- all' :: MonadQuery m => m ()
- class (Functor m, Monad m) => MonadRestrict c (m :: Type -> Type) where
- class (Functor m, Monad m, MonadQualify ConfigureQuery m) => MonadQuery (m :: Type -> Type) where
- query' :: Relation p r -> m (PlaceHolders p, Record Flat r)
- queryMaybe' :: Relation p r -> m (PlaceHolders p, Record Flat (Maybe r))
- class (Functor q, Monad q, Functor m, Monad m) => MonadQualify (q :: Type -> Type) (m :: Type -> Type)
- class MonadQuery m => MonadAggregate (m :: Type -> Type) where
- groupBy :: Record Flat r -> m (Record Aggregated r)
- groupBy' :: AggregateKey (Record Aggregated r) -> m (Record Aggregated r)
- class Monad m => MonadPartition c (m :: Type -> Type) where
- partitionBy :: Record c r -> m ()
- (??) :: PersistableWidth a => Record c (Maybe a) -> Pi a (Maybe b) -> Record c (Maybe b)
- (?) :: PersistableWidth a => Record c (Maybe a) -> Pi a b -> Record c (Maybe b)
- (!??) :: (PersistableWidth a, ProjectableFlattenMaybe (Maybe b) c) => Record cont (Maybe a) -> Pi a b -> Record cont c
- flattenPiMaybe :: (PersistableWidth a, ProjectableFlattenMaybe (Maybe b) c) => Record cont (Maybe a) -> Pi a b -> Record cont c
- (?!?) :: PersistableWidth a => Record c (Maybe a) -> Pi a (Maybe b) -> Record c (Maybe b)
- (?!) :: PersistableWidth a => Record c (Maybe a) -> Pi a b -> Record c (Maybe b)
- (!) :: PersistableWidth a => Record c a -> Pi a b -> Record c b
- some' :: (AggregatedContext ac, SqlContext ac) => Predicate Flat -> Record ac (Maybe Bool)
- any' :: (AggregatedContext ac, SqlContext ac) => Predicate Flat -> Record ac (Maybe Bool)
- every :: (AggregatedContext ac, SqlContext ac) => Predicate Flat -> Record ac (Maybe Bool)
- min' :: (Ord a, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac (Maybe a)
- minMaybe :: (Ord a, AggregatedContext ac, SqlContext ac) => Record Flat (Maybe a) -> Record ac (Maybe a)
- max' :: (Ord a, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac (Maybe a)
- maxMaybe :: (Ord a, AggregatedContext ac, SqlContext ac) => Record Flat (Maybe a) -> Record ac (Maybe a)
- avg :: (Num a, Fractional b, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac (Maybe b)
- avgMaybe :: (Num a, Fractional b, AggregatedContext ac, SqlContext ac) => Record Flat (Maybe a) -> Record ac (Maybe b)
- sum' :: (Num a, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac (Maybe a)
- sumMaybe :: (Num a, AggregatedContext ac, SqlContext ac) => Record Flat (Maybe a) -> Record ac (Maybe a)
- count :: (Integral b, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac b
- unsafeAggregateOp :: (AggregatedContext ac, SqlContext ac) => Keyword -> Record Flat a -> Record ac b
- (><) :: ProductIsoApplicative p => p a -> p b -> p (a, b)
- projectZip :: ProductIsoApplicative p => p a -> p b -> p (a, b)
- placeholder :: (PersistableWidth t, SqlContext c, Monad m) => (Record c t -> m a) -> m (PlaceHolders t, a)
- placeholder' :: (PersistableWidth t, SqlContext c) => (Record c t -> a) -> (PlaceHolders t, a)
- pwPlaceholder :: SqlContext c => PersistableRecordWidth a -> (Record c a -> b) -> (PlaceHolders a, b)
- unitPH :: PlaceHolders ()
- unitPlaceHolder :: PlaceHolders ()
- unsafePlaceHolders :: PlaceHolders p
- unsafeAddPlaceHolders :: Functor f => f a -> f (PlaceHolders p, a)
- cumeDist :: Record OverWindow Double
- percentRank :: Record OverWindow Double
- rowNumber :: Integral a => Record OverWindow a
- denseRank :: Integral a => Record OverWindow a
- rank :: Integral a => Record OverWindow a
- fromMaybe :: (OperatorContext c, HasColumnConstraint NotNull r) => Record c r -> Record c (Maybe r) -> Record c r
- isJust :: (OperatorContext c, HasColumnConstraint NotNull r) => Record c (Maybe r) -> Predicate c
- isNothing :: (OperatorContext c, HasColumnConstraint NotNull r) => Record c (Maybe r) -> Predicate c
- in' :: OperatorContext c => Record c t -> RecordList (Record c) t -> Record c (Maybe Bool)
- caseMaybe :: (OperatorContext c, PersistableWidth b) => Record c a -> [(Record c a, Record c (Maybe b))] -> Record c (Maybe b)
- casesOrElse' :: OperatorContext c => (Record c a, [(Record c a, Record c b)]) -> Record c b -> Record c b
- case' :: OperatorContext c => Record c a -> [(Record c a, Record c b)] -> Record c b -> Record c b
- caseSearchMaybe :: (OperatorContext c, PersistableWidth a) => [(Predicate c, Record c (Maybe a))] -> Record c (Maybe a)
- casesOrElse :: OperatorContext c => [(Predicate c, Record c a)] -> Record c a -> Record c a
- caseSearch :: OperatorContext c => [(Predicate c, Record c a)] -> Record c a -> Record c a
- showNumMaybe :: (SqlContext c, Num a, IsString b) => Record c (Maybe a) -> Record c (Maybe b)
- fromIntegralMaybe :: (SqlContext c, Integral a, Num b) => Record c (Maybe a) -> Record c (Maybe b)
- negateMaybe :: (OperatorContext c, Num a) => Record c (Maybe a) -> Record c (Maybe a)
- (?*?) :: (OperatorContext c, Num a) => Record c (Maybe a) -> Record c (Maybe a) -> Record c (Maybe a)
- (?/?) :: (OperatorContext c, Num a) => Record c (Maybe a) -> Record c (Maybe a) -> Record c (Maybe a)
- (?-?) :: (OperatorContext c, Num a) => Record c (Maybe a) -> Record c (Maybe a) -> Record c (Maybe a)
- (?+?) :: (OperatorContext c, Num a) => Record c (Maybe a) -> Record c (Maybe a) -> Record c (Maybe a)
- showNum :: (SqlContext c, Num a, IsString b) => Record c a -> Record c b
- fromIntegral' :: (SqlContext c, Integral a, Num b) => Record c a -> Record c b
- negate' :: (OperatorContext c, Num a) => Record c a -> Record c a
- (.*.) :: (OperatorContext c, Num a) => Record c a -> Record c a -> Record c a
- (./.) :: (OperatorContext c, Num a) => Record c a -> Record c a -> Record c a
- (.-.) :: (OperatorContext c, Num a) => Record c a -> Record c a -> Record c a
- (.+.) :: (OperatorContext c, Num a) => Record c a -> Record c a -> Record c a
- likeMaybe :: (OperatorContext c, IsString a, LiteralSQL a) => Record c (Maybe a) -> a -> Record c (Maybe Bool)
- like :: (OperatorContext c, IsString a, LiteralSQL a) => Record c a -> a -> Record c (Maybe Bool)
- likeMaybe' :: (OperatorContext c, IsString a) => Record c (Maybe a) -> Record c (Maybe a) -> Record c (Maybe Bool)
- like' :: (OperatorContext c, IsString a) => Record c a -> Record c a -> Record c (Maybe Bool)
- (?||?) :: (OperatorContext c, IsString a) => Record c (Maybe a) -> Record c (Maybe a) -> Record c (Maybe a)
- (.||.) :: OperatorContext c => Record c a -> Record c a -> Record c a
- exists :: OperatorContext c => RecordList (Record Exists) r -> Record c (Maybe Bool)
- not' :: OperatorContext c => Record c (Maybe Bool) -> Record c (Maybe Bool)
- or' :: OperatorContext c => Record c (Maybe Bool) -> Record c (Maybe Bool) -> Record c (Maybe Bool)
- and' :: OperatorContext c => Record c (Maybe Bool) -> Record c (Maybe Bool) -> Record c (Maybe Bool)
- (.<>.) :: OperatorContext c => Record c ft -> Record c ft -> Record c (Maybe Bool)
- (.>=.) :: OperatorContext c => Record c ft -> Record c ft -> Record c (Maybe Bool)
- (.>.) :: OperatorContext c => Record c ft -> Record c ft -> Record c (Maybe Bool)
- (.<=.) :: OperatorContext c => Record c ft -> Record c ft -> Record c (Maybe Bool)
- (.<.) :: OperatorContext c => Record c ft -> Record c ft -> Record c (Maybe Bool)
- (.=.) :: OperatorContext c => Record c ft -> Record c ft -> Record c (Maybe Bool)
- unsafeBinOp :: SqlContext k => SqlBinOp -> Record k a -> Record k b -> Record k c
- unsafeUniOp :: SqlContext c2 => (Keyword -> Keyword) -> Record c1 a -> Record c2 b
- unsafeShowSql :: Record c a -> String
- unsafeShowSql' :: Record c a -> StringSQL
- values :: (LiteralSQL t, OperatorContext c) => [t] -> RecordList (Record c) t
- valueFalse :: OperatorContext c => Record c (Maybe Bool)
- valueTrue :: OperatorContext c => Record c (Maybe Bool)
- value :: (LiteralSQL t, OperatorContext c) => t -> Record c t
- nothing :: (OperatorContext c, SqlContext c, PersistableWidth a) => Record c (Maybe a)
- unsafeProjectSql :: SqlContext c => String -> Record c t
- unsafeProjectSql' :: SqlContext c => StringSQL -> Record c t
- type SqlBinOp = Keyword -> Keyword -> Keyword
- class ProjectableMaybe (p :: Type -> Type) where
- class ProjectableFlattenMaybe a b where
- flatten :: ProjectableMaybe p => p a -> p b
- snd' :: (PersistableWidth a, PersistableWidth b) => Pi (a, b) b
- fst' :: (PersistableWidth a, PersistableWidth b) => Pi (a, b) a
- tuplePi7_6' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6, PersistableWidth a7) => Pi (a1, a2, a3, a4, a5, a6, a7) a7
- tuplePi7_5' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6, PersistableWidth a7) => Pi (a1, a2, a3, a4, a5, a6, a7) a6
- tuplePi7_4' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6, PersistableWidth a7) => Pi (a1, a2, a3, a4, a5, a6, a7) a5
- tuplePi7_3' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6, PersistableWidth a7) => Pi (a1, a2, a3, a4, a5, a6, a7) a4
- tuplePi7_2' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6, PersistableWidth a7) => Pi (a1, a2, a3, a4, a5, a6, a7) a3
- tuplePi7_1' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6, PersistableWidth a7) => Pi (a1, a2, a3, a4, a5, a6, a7) a2
- tuplePi7_0' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6, PersistableWidth a7) => Pi (a1, a2, a3, a4, a5, a6, a7) a1
- tuplePi6_5' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6) => Pi (a1, a2, a3, a4, a5, a6) a6
- tuplePi6_4' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6) => Pi (a1, a2, a3, a4, a5, a6) a5
- tuplePi6_3' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6) => Pi (a1, a2, a3, a4, a5, a6) a4
- tuplePi6_2' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6) => Pi (a1, a2, a3, a4, a5, a6) a3
- tuplePi6_1' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6) => Pi (a1, a2, a3, a4, a5, a6) a2
- tuplePi6_0' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6) => Pi (a1, a2, a3, a4, a5, a6) a1
- tuplePi5_4' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5) => Pi (a1, a2, a3, a4, a5) a5
- tuplePi5_3' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5) => Pi (a1, a2, a3, a4, a5) a4
- tuplePi5_2' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5) => Pi (a1, a2, a3, a4, a5) a3
- tuplePi5_1' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5) => Pi (a1, a2, a3, a4, a5) a2
- tuplePi5_0' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5) => Pi (a1, a2, a3, a4, a5) a1
- tuplePi4_3' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4) => Pi (a1, a2, a3, a4) a4
- tuplePi4_2' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4) => Pi (a1, a2, a3, a4) a3
- tuplePi4_1' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4) => Pi (a1, a2, a3, a4) a2
- tuplePi4_0' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4) => Pi (a1, a2, a3, a4) a1
- tuplePi3_2' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3) => Pi (a1, a2, a3) a3
- tuplePi3_1' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3) => Pi (a1, a2, a3) a2
- tuplePi3_0' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3) => Pi (a1, a2, a3) a1
- tuplePi2_1' :: (PersistableWidth a1, PersistableWidth a2) => Pi (a1, a2) a2
- tuplePi2_0' :: (PersistableWidth a1, PersistableWidth a2) => Pi (a1, a2) a1
- updateOtherThanKeySQL :: Table r -> Pi r p -> String
- type QuerySuffix = [Keyword]
- list :: [p t] -> RecordList p t
- data RecordList (p :: Type -> Type) t
- data Table r
- class PersistableWidth r => TableDerivable r where
- derivedTable :: Table r
- dump :: Relation p r -> String
- sqlFromRelation :: Relation p r -> StringSQL
- sqlFromRelationWith :: Relation p r -> Config -> StringSQL
- leftPh :: Relation (p, ()) r -> Relation p r
- rightPh :: Relation ((), p) r -> Relation p r
- relationWidth :: Relation p r -> PersistableRecordWidth r
- untypeRelation :: Relation p r -> ConfigureQuery SubQuery
- unsafeTypeRelation :: ConfigureQuery SubQuery -> Relation p r
- askConfig :: ConfigureQuery Config
- qualifyQuery :: a -> ConfigureQuery (Qualified a)
- configureQuery :: ConfigureQuery q -> Config -> q
- type ConfigureQuery = Qualify (QueryConfig Identity)
- data Relation p r
- class SqlContext c where
- unsafeProjectSqlTerms :: [StringSQL] -> Record c t
- data PlaceHolders p
- unitSQL :: SubQuery -> String
- queryWidth :: Qualified SubQuery -> Int
- data Order
- data Nulls
- data AggregateKey a
- data SubQuery
- data Record c t
- type Predicate c = Record c (Maybe Bool)
- type PI c a b = Record c a -> Record c b
- class PersistableWidth ct => ScalarDegree ct
- showConstantTermsSQL :: ShowConstantTermsSQL a => a -> [StringSQL]
- showConstantTermsSQL' :: ShowConstantTermsSQL a => a -> DList StringSQL
- showLiteral :: LiteralSQL a => a -> [StringSQL]
- class LiteralSQL a where
- showLiteral' :: a -> DList StringSQL
- type ShowConstantTermsSQL = LiteralSQL
- derivedUniqueKey :: HasConstraintKey Primary r ct => Key Unique r ct
- uniqueKey :: PersistableWidth ct => Key Primary r ct -> Key Unique r ct
- projectionKey :: Key c r ct -> Pi r ct
- tableConstraint :: Key c r ct -> KeyConstraint c r
- data Key c r ct
- class PersistableWidth ct => HasConstraintKey c r ct where
- constraintKey :: Key c r ct
- id' :: Pi a a
- (<?.?>) :: Pi a (Maybe b) -> Pi b (Maybe c) -> Pi a (Maybe c)
- (<?.>) :: Pi a (Maybe b) -> Pi b c -> Pi a (Maybe c)
- (<.>) :: Pi a b -> Pi b c -> Pi a c
- expandIndexes :: PersistableWidth a => Pi a b -> [Int]
- expandIndexes' :: PersistableRecordWidth a -> Pi a b -> [Int]
- data Pi r0 r1
- type StringSQL = Keyword
- data Flat
- data Aggregated
- data Exists
- data OverWindow
- data Set
- data SetList
- data Power
- defaultConfig :: Config
- defaultNameConfig :: NameConfig
- data NameConfig
- data ProductUnitSupport
- data SchemaNameMode
- data IdentifierQuotation
- data Config
- relationalQuery :: Relation p r -> [Keyword] -> Query p r
- insertValue :: TableDerivable r => Register r (PlaceHolders p) -> Insert p
- insertValueNoPH :: TableDerivable r => Register r () -> Insert ()
- insertQuery :: TableDerivable r => Pi r r' -> Relation p r' -> InsertQuery p
- update :: TableDerivable r => (Record Flat r -> Assign r (PlaceHolders p)) -> Update p
- updateNoPH :: TableDerivable r => (Record Flat r -> Assign r ()) -> Update ()
- delete :: TableDerivable r => (Record Flat r -> Restrict (PlaceHolders p)) -> Delete p
- deleteNoPH :: TableDerivable r => (Record Flat r -> Restrict ()) -> Delete ()
Documentation
Constraint type. Not-null key.
Instances
HasColumnConstraint NotNull a => HasColumnConstraint NotNull (a, b) | Inference rule of |
Defined in Database.Record.KeyConstraint columnConstraint :: ColumnConstraint NotNull (a, b) # |
:: TableDerivable r | |
=> Key Unique r k | Unique key proof object which record type is |
-> Record c k | Unique key value to specify. |
-> UniqueRelation () c r | Result restricted |
UniqueRelation
inferred from table.
:: HasConstraintKey Primary r p | |
=> Table r |
|
-> KeyUpdate p r | Result typed |
Typed KeyUpdate
using inferred primary key.
:: Table r |
|
-> Key c r p | Key with constraint |
-> KeyUpdate p r | Result typed |
Typed KeyUpdate
using specified constraint key.
updateValuesWithKey :: ToSql q r => Pi r p -> r -> [q] #
Convert from Haskell type r
into SQL value q
list expected by update form like
UPDATE table SET c0 = ?, c1 = ?, ..., cn = ? WHERE key0 = ? AND key1 = ? AND key2 = ? ...
using derived RecordToSql
proof object.
:: HasConstraintKey Primary a p | |
=> Relation () a |
|
-> Relation p a | Result restricted |
Query restricted with inferred primary key.
:: PersistableWidth p | |
=> Key Primary a p | Primary key proof object which record type is |
-> Relation () a |
|
-> Relation p a | Result restricted |
Deprecated.
:: PersistableWidth p | |
=> Key Unique a p | Unique key proof object which record type is |
-> Relation () a |
|
-> Relation p a | Result restricted |
Query restricted with specified unique key.
:: PersistableWidth p | |
=> Pi a p | Projection path |
-> Relation () a |
|
-> Relation p a | Result restricted |
Query restricted with specified key.
:: (PersistableWidth s, Integral i, LiteralSQL i) | |
=> i | sequence number to set. expect not SQL injectable. |
-> Sequence s i | sequence table |
-> Update () |
Update statement for sequence table
:: (PersistableWidth s, Integral i, LiteralSQL i) | |
=> Config | |
-> i | sequence number to set. expect not SQL injectable. |
-> Sequence s i | sequence table |
-> Update () |
Update statement for sequence table
:: Binding r s i | |
=> (i -> r) | sequence number should be passed to proper field of record |
-> Number r i | |
-> r |
Unsafely apply sequence number. Only safe to build corresponding record type.
:: (i -> r) | sequence number should be passed to proper field of record |
-> Number r i | |
-> r |
Unsafely apply sequence number.
extractNumber :: Number r i -> i #
Get untyped sequence number.
unsafeSpecifyNumber :: Binding r s i => i -> Number r i #
Unsafely specify sequence number.
fromRelation :: Binding r s i => Relation () r -> Sequence s i #
primaryBinding :: (TableDerivable r, SequenceDerivable s i, HasConstraintKey Primary r i) => SeqBinding r s i #
Derive binding using primary key.
unsafeSpecifyBinding :: (TableDerivable r, SequenceDerivable s i) => Pi r i -> SeqBinding r s i #
Unsafely specify binding between normal-table and sequence-table.
seqRelation :: TableDerivable s => Sequence s i -> Relation () s #
Infer Relation
of sequence table
unsafeSpecifySequence :: TableDerivable s => (s -> i) -> Pi s i -> Sequence s i #
Unsafely specify sequence table.
Basic record to express sequence-table. actual sequence-table is a table which has only one column of integer type.
class TableDerivable s => SequenceDerivable s i | s -> i where #
Sequence
derivation rule
derivedSequence :: Sequence s i #
data SeqBinding r s i #
Record to express binding between normal-table and sequence-table.
class (TableDerivable r, SequenceDerivable s i) => Binding r s i | r -> s where #
Nothing
binding :: SeqBinding r s i #
Sequence number type for record type r
Instances
Show i => Show (Number r i) | |
Eq i => Eq (Number r i) | |
Ord i => Ord (Number r i) | |
Defined in Database.Relational.Sequence |
derivedDelete :: TableDerivable r => (Record Flat r -> Restrict (PlaceHolders p)) -> Delete p #
Make typed Delete
from defaultConfig
, derived table and Restrict
computation.
derivedDelete' :: TableDerivable r => Config -> (Record Flat r -> Restrict (PlaceHolders p)) -> Delete p #
delete' :: TableDerivable r => Config -> (Record Flat r -> Restrict (PlaceHolders p)) -> Delete p #
typedDelete :: Table r -> (Record Flat r -> Restrict (PlaceHolders p)) -> Delete p #
typedDelete' :: Config -> Table r -> (Record Flat r -> Restrict (PlaceHolders p)) -> Delete p #
derivedInsertQuery :: TableDerivable r => Pi r r' -> Relation p r' -> InsertQuery p #
Table type inferred InsertQuery
.
insertQuery' :: TableDerivable r => Config -> Pi r r' -> Relation p r' -> InsertQuery p #
Table type inferred InsertQuery
.
typedInsertQuery :: Table r -> Pi r r' -> Relation p r' -> InsertQuery p #
Make typed InsertQuery
from columns selector Table
, Pi
and Relation
.
typedInsertQuery' :: Config -> Table r -> Pi r r' -> Relation p r' -> InsertQuery p #
Make typed InsertQuery
from columns selector Table
, Pi
and Relation
with configuration parameter.
insertValueList :: (TableDerivable r, LiteralSQL r') => Pi r r' -> [r'] -> [Insert ()] #
Make typed Insert
list from records list.
insertValueList' :: (TableDerivable r, LiteralSQL r') => Config -> Pi r r' -> [r'] -> [Insert ()] #
derivedInsertValue :: TableDerivable r => Register r (PlaceHolders p) -> Insert p #
Make typed Insert
from defaultConfig
, derived table and monadic built Register
object.
derivedInsertValue' :: TableDerivable r => Config -> Register r (PlaceHolders p) -> Insert p #
insertValue' :: TableDerivable r => Config -> Register r (PlaceHolders p) -> Insert p #
typedInsertValue :: Table r -> InsertTarget p r -> Insert p #
Make typed Insert
from Table
and monadic built InsertTarget
object.
typedInsertValue' :: Config -> Table r -> InsertTarget p r -> Insert p #
Make typed Insert
from Config
, Table
and monadic built InsertTarget
object.
derivedInsert :: (PersistableWidth r, TableDerivable r) => Pi r r' -> Insert r' #
Table type inferred Insert
.
insert :: (PersistableWidth r, TableDerivable r) => Pi r r' -> Insert r' #
Table type inferred Insert
.
typedInsert :: PersistableWidth r => Table r -> Pi r r' -> Insert r' #
typedInsert' :: PersistableWidth r => Config -> Table r -> Pi r r' -> Insert r' #
unsafeTypedInsert' :: String -> String -> Int -> Insert a #
Unsafely make typed Insert
from single insert and chunked insert SQL.
chunkSizeOfInsert :: Insert a -> Int #
Size to use chunked insert
untypeChunkInsert :: Insert a -> String #
Statement to use chunked insert
derivedUpdateAllColumn :: (PersistableWidth r, TableDerivable r) => (Record Flat r -> Restrict (PlaceHolders p)) -> Update (r, p) #
Deprecated. use updateAllColumn
.
updateAllColumnNoPH :: (PersistableWidth r, TableDerivable r) => (Record Flat r -> Restrict ()) -> Update r #
Make typed Update
from defaultConfig
, derived table and Restrict
computation
without placeholder other than target table columns.
Update target is all column.
updateAllColumn :: (PersistableWidth r, TableDerivable r) => (Record Flat r -> Restrict (PlaceHolders p)) -> Update (r, p) #
Make typed Update
from defaultConfig
, derived table and Restrict
computation.
Update target is all column.
derivedUpdateAllColumn' :: (PersistableWidth r, TableDerivable r) => Config -> (Record Flat r -> Restrict (PlaceHolders p)) -> Update (r, p) #
Deprecated. use updateAllColumn'
.
updateAllColumn' :: (PersistableWidth r, TableDerivable r) => Config -> (Record Flat r -> Restrict (PlaceHolders p)) -> Update (r, p) #
typedUpdateAllColumn :: PersistableWidth r => Table r -> (Record Flat r -> Restrict (PlaceHolders p)) -> Update (r, p) #
derivedUpdate :: TableDerivable r => (Record Flat r -> Assign r (PlaceHolders p)) -> Update p #
Make typed Update
from defaultConfig
, derived table and Assign
computation.
derivedUpdate' :: TableDerivable r => Config -> (Record Flat r -> Assign r (PlaceHolders p)) -> Update p #
update' :: TableDerivable r => Config -> (Record Flat r -> Assign r (PlaceHolders p)) -> Update p #
typedUpdate :: Table r -> (Record Flat r -> Assign r (PlaceHolders p)) -> Update p #
Make typed Update
using defaultConfig
, Table
and Assign
computation.
typedUpdate' :: Config -> Table r -> (Record Flat r -> Assign r (PlaceHolders p)) -> Update p #
unsafeTypedUpdate :: String -> Update p #
Unsafely make typed Update
from SQL string.
derivedKeyUpdate :: TableDerivable r => Pi r p -> KeyUpdate p r #
keyUpdate :: TableDerivable r => Pi r p -> KeyUpdate p r #
typedKeyUpdateTable :: TableDerivable r => Relation () r -> Pi r p -> KeyUpdate p r #
typedKeyUpdate :: Table a -> Pi a p -> KeyUpdate p a #
relationalQuery' :: Relation p r -> QuerySuffix -> Query p r #
relationalQuery_ :: Config -> Relation p r -> QuerySuffix -> Query p r #
relationalQuerySQL :: Config -> Relation p r -> QuerySuffix -> String #
From Relation
into untyped SQL query string.
Unsafely make typed Query
from SQL string.
Query type with place-holder parameter p
and query result type a
.
Update type with key type p
and update record type a
.
Columns to update are record columns other than key columns,
So place-holder parameter type is the same as record type a
.
KeyUpdate | |
|
Update type with place-holder parameter p
.
Insert type to insert record type a
.
Insert | |
|
newtype InsertQuery p #
InsertQuery type.
Instances
UntypeableNoFetch InsertQuery | |
Defined in Database.Relational.Type untypeNoFetch :: InsertQuery p -> String # | |
Show (InsertQuery p) | Show insert SQL string. |
Defined in Database.Relational.Type showsPrec :: Int -> InsertQuery p -> ShowS # show :: InsertQuery p -> String # showList :: [InsertQuery p] -> ShowS # |
Delete type with place-holder parameter p
.
class UntypeableNoFetch (s :: Type -> Type) where #
Untype interface for typed no-result type statements
with single type parameter which represents place-holder parameter p
.
untypeNoFetch :: s p -> String #
Instances
UntypeableNoFetch Delete | |
Defined in Database.Relational.Type untypeNoFetch :: Delete p -> String # | |
UntypeableNoFetch Insert | |
Defined in Database.Relational.Type untypeNoFetch :: Insert p -> String # | |
UntypeableNoFetch InsertQuery | |
Defined in Database.Relational.Type untypeNoFetch :: InsertQuery p -> String # | |
UntypeableNoFetch Update | |
Defined in Database.Relational.Type untypeNoFetch :: Update p -> String # |
sqlChunksFromRecordList :: LiteralSQL r' => Config -> Table r -> Pi r r' -> [r'] -> [StringSQL] #
Make StringSQL
strings of SQL INSERT strings from records list
sqlFromInsertTarget :: Config -> Table r -> InsertTarget p r -> StringSQL #
Make StringSQL
string of SQL INSERT statement from InsertTarget
sqlChunkFromInsertTarget :: Config -> Table r -> InsertTarget p r -> (StringSQL, Int) #
Make StringSQL
string of SQL INSERT record chunk statement from InsertTarget
piRegister :: PersistableWidth r => Pi r r' -> Register r (PlaceHolders r') #
insertTarget' :: Register r (PlaceHolders p) -> InsertTarget p r #
Finalize Register
monad and generate InsertTarget
with place-holder parameter p
.
insertTarget :: Register r () -> InsertTarget () r #
Finalize Register
monad and generate InsertTarget
.
sqlFromUpdateTarget :: Config -> Table r -> (Record Flat r -> Assign r (PlaceHolders p)) -> StringSQL #
updateTargetAllColumn' :: PersistableWidth r => (Record Flat r -> Restrict (PlaceHolders p)) -> Record Flat r -> Assign r (PlaceHolders (r, p)) #
Deprecated.
updateTargetAllColumn :: PersistableWidth r => (Record Flat r -> Restrict ()) -> Record Flat r -> Assign r (PlaceHolders r) #
Deprecated.
liftTargetAllColumn' :: PersistableWidth r => (Record Flat r -> Restrict (PlaceHolders p)) -> Record Flat r -> Assign r (PlaceHolders (r, p)) #
liftTargetAllColumn :: PersistableWidth r => (Record Flat r -> Restrict (PlaceHolders ())) -> Record Flat r -> Assign r (PlaceHolders r) #
updateTarget' :: (Record Flat r -> Assign r (PlaceHolders p)) -> UpdateTarget p r #
Deprecated.
updateTarget :: (Record Flat r -> Assign r ()) -> UpdateTarget () r #
Deprecated.
sqlWhereFromRestriction :: Config -> Table r -> (Record Flat r -> Restrict (PlaceHolders p)) -> StringSQL #
restriction' :: (Record Flat r -> Restrict (PlaceHolders p)) -> Restriction p r #
Deprecated.
restriction :: (Record Flat r -> Restrict ()) -> Restriction () r #
Deprecated.
type Restriction p r = Record Flat r -> Restrict (PlaceHolders p) #
Restriction type with place-holder parameter p
and projected record type r
.
type UpdateTarget p r = Record Flat r -> Assign r (PlaceHolders p) #
UpdateTarget type with place-holder parameter p
and projected record type r
.
data InsertTarget p r #
InsertTarget type with place-holder parameter p
and projected record type r
.
intersectAll' :: Relation p a -> Relation q a -> Relation (p, q) a infixl 8 #
Intersection of two relations with place-holder parameters. Not distinct.
intersect' :: Relation p a -> Relation q a -> Relation (p, q) a infixl 8 #
Intersection of two relations with place-holder parameters.
exceptAll' :: Relation p a -> Relation q a -> Relation (p, q) a infixl 7 #
Subtraction of two relations with place-holder parameters. Not distinct.
except' :: Relation p a -> Relation q a -> Relation (p, q) a infixl 7 #
Subtraction of two relations with place-holder parameters.
unionAll' :: Relation p a -> Relation q a -> Relation (p, q) a infixl 7 #
Union of two relations with place-holder parameters. Not distinct.
union' :: Relation p a -> Relation q a -> Relation (p, q) a infixl 7 #
Union of two relations with place-holder parameters.
intersectAll :: Relation () a -> Relation () a -> Relation () a infixl 8 #
Intersection of two relations. Not distinct.
intersect :: Relation () a -> Relation () a -> Relation () a infixl 8 #
Intersection of two relations.
exceptAll :: Relation () a -> Relation () a -> Relation () a infixl 7 #
Subtraction of two relations. Not distinct.
unionAll :: Relation () a -> Relation () a -> Relation () a infixl 7 #
Union of two relations. Not distinct.
on' :: ([JoinRestriction a b] -> Relation pc (a, b)) -> [JoinRestriction a b] -> Relation pc (a, b) infixl 8 #
Apply restriction for direct join style.
:: Relation () a | Left query to join |
-> Relation () b | Right query to join |
-> [JoinRestriction (Maybe a) (Maybe b)] | Join restrictions |
-> Relation () (Maybe a, Maybe b) | Result joined relation |
Direct full outer join.
:: Relation () a | Left query to join |
-> Relation () b | Right query to join |
-> [JoinRestriction (Maybe a) b] | Join restrictions |
-> Relation () (Maybe a, b) | Result joined relation |
Direct right outer join.
:: Relation () a | Left query to join |
-> Relation () b | Right query to join |
-> [JoinRestriction a (Maybe b)] | Join restrictions |
-> Relation () (a, Maybe b) | Result joined relation |
Direct left outer join.
:: Relation () a | Left query to join |
-> Relation () b | Right query to join |
-> [JoinRestriction a b] | Join restrictions |
-> Relation () (a, b) | Result joined relation |
Direct inner join.
:: Relation pa a | Left query to join |
-> Relation pb b | Right query to join |
-> [JoinRestriction (Maybe a) (Maybe b)] | Join restrictions |
-> Relation (pa, pb) (Maybe a, Maybe b) | Result joined relation |
Direct full outer join with place-holder parameters.
:: Relation pa a | Left query to join |
-> Relation pb b | Right query to join |
-> [JoinRestriction (Maybe a) b] | Join restrictions |
-> Relation (pa, pb) (Maybe a, b) | Result joined relation |
Direct right outer join with place-holder parameters.
:: Relation pa a | Left query to join |
-> Relation pb b | Right query to join |
-> [JoinRestriction a (Maybe b)] | Join restrictions |
-> Relation (pa, pb) (a, Maybe b) | Result joined relation |
Direct left outer join with place-holder parameters.
:: Relation pa a | Left query to join |
-> Relation pb b | Right query to join |
-> [JoinRestriction a b] | Join restrictions |
-> Relation (pa, pb) (a, b) | Result joined relation |
Direct inner join with place-holder parameters.
queryScalar :: (MonadQualify ConfigureQuery m, ScalarDegree r) => UniqueRelation () c r -> m (Record c (Maybe r)) #
Scalar sub-query.
queryScalar' :: (MonadQualify ConfigureQuery m, ScalarDegree r) => UniqueRelation p c r -> m (PlaceHolders p, Record c (Maybe r)) #
Scalar sub-query with place-holder parameter p
.
aggregatedUnique :: Relation ph r -> Pi r a -> (Record Flat a -> Record Aggregated b) -> UniqueRelation ph Flat b #
Aggregated UniqueRelation
.
uniqueRelation' :: QueryUnique (PlaceHolders p, Record c r) -> UniqueRelation p c r #
Finalize QueryUnique
monad and generate UniqueRelation
.
uniqueQueryMaybe' :: UniqueRelation p c r -> QueryUnique (PlaceHolders p, Record c (Maybe r)) #
Join unique sub-query with place-holder parameter p
. Query result is NodeAttr
.
uniqueQuery' :: UniqueRelation p c r -> QueryUnique (PlaceHolders p, Record c r) #
Join unique sub-query with place-holder parameter p
.
unUnique :: UniqueRelation p c r -> Relation p r #
Discard unique attribute.
unsafeUnique :: Relation p r -> UniqueRelation p c r #
Unsafely specify unique relation.
aggregateRelation :: QueryAggregate (Record Aggregated r) -> Relation () r #
Finalize QueryAggregate
monad and generate Relation
.
aggregateRelation' :: AggregatedQuery p r -> Relation p r #
Finalize QueryAggregate
monad and generate Relation
with place-holder parameter p
.
relation :: QuerySimple (Record Flat r) -> Relation () r #
Finalize QuerySimple
monad and generate Relation
.
relation' :: SimpleQuery p r -> Relation p r #
Finalize QuerySimple
monad and generate Relation
with place-holder parameter p
.
queryList :: MonadQualify ConfigureQuery m => Relation () r -> m (RecordList (Record c) r) #
List sub-query, for IN and EXIST.
queryList' :: MonadQualify ConfigureQuery m => Relation p r -> m (PlaceHolders p, RecordList (Record c) r) #
List sub-query, for IN and EXIST with place-holder parameter p
.
queryMaybe :: (MonadQualify ConfigureQuery m, MonadQuery m) => Relation () r -> m (Record Flat (Maybe r)) #
Join sub-query. Query result is NodeAttr
.
The combinations of query
and queryMaybe
express
inner joins, left outer joins, right outer joins, and full outer joins.
Here is an example of a right outer join:
outerJoin = relation $ do e <- queryMaybe employee d <- query department on $ e ?! E.deptId' .=. just (d ! D.deptId') return $ (,) |$| e |*| d
query :: (MonadQualify ConfigureQuery m, MonadQuery m) => Relation () r -> m (Record Flat r) #
Join sub-query. Query result is not NodeAttr
.
derivedRelation :: TableDerivable r => Relation () r #
Inferred Relation
.
data UniqueRelation p c r #
Unique relation type to compose scalar queries.
over :: SqlContext c => Record OverWindow a -> Window c () -> Record c a infix 8 #
Operator to make record of window function result using built Window
monad.
type QueryAggregate = Orderings Aggregated (Restrictings Aggregated (AggregatingSetT QueryCore)) #
Aggregated query monad type.
type AggregatedQuery p r = OrderedQuery Aggregated (Restrictings Aggregated (AggregatingSetT QueryCore)) p r #
Aggregated query type. AggregatedQuery
p r == QueryAggregate
(PlaceHolders
p, Record
Aggregated
r).
type Window c = Orderings c (PartitioningSet c) #
Partition monad type for partition-by clause.
groupingSets :: AggregatingSetList a -> AggregateKey a #
Finalize grouping set list.
cube :: AggregatingPowerSet a -> AggregateKey a #
Finalize grouping power set as cube power set.
rollup :: AggregatingPowerSet a -> AggregateKey a #
Finalize grouping power set as rollup power set.
bkey :: Record Flat r -> AggregatingPowerSet (Record Aggregated (Maybe r)) #
Specify key of rollup and cube power set.
set :: AggregatingSet a -> AggregatingSetList a #
Finalize and specify single grouping set.
key' :: AggregateKey a -> AggregatingSet a #
Specify key of single grouping set.
key :: Record Flat r -> AggregatingSet (Record Aggregated (Maybe r)) #
Specify key of single grouping set from Record.
type Assign r = Assignings r Restrict #
Target update monad type used from update statement and merge statement.
type Register r = Assignings r ConfigureQuery #
Target register monad type used from insert statement.
(<-#) :: forall (m :: Type -> Type) r v. Monad m => AssignTarget r v -> Record Flat v -> Assignings r m () infix 4 #
Add and assignment.
assignTo :: forall (m :: Type -> Type) v r. Monad m => Record Flat v -> AssignTarget r v -> Assignings r m () #
Add an assignment.
type QuerySimple = Orderings Flat QueryCore #
Simple (not-aggregated) query monad type.
type SimpleQuery p r = OrderedQuery Flat QueryCore p r #
Simple (not-aggregated) query type. SimpleQuery'
p r == QuerySimple
(PlaceHolders
p, Record
r).
data QueryUnique a #
Unique query monad type.
Instances
extractCore :: QueryCore a -> ConfigureQuery (((a, [Predicate Flat]), JoinProduct), Duplication) #
Extract QueryCore
computation.
type QueryCore = Restrictings Flat (QueryJoin ConfigureQuery) #
Core query monad type used from flat(not-aggregated) query and aggregated query.
type OrderedQuery c (m :: Type -> Type) p r = Orderings c m (PlaceHolders p, Record c r) #
OrderedQuery monad type with placeholder type p
. Record must be the same as Orderings
context type parameter c
.
:: forall (m :: Type -> Type) c t. Monad m | |
=> Record c t | Ordering terms to add |
-> Orderings c m () | Result context with ordering |
Add descendant ordering term.
:: forall (m :: Type -> Type) c t. Monad m | |
=> Record c t | Ordering terms to add |
-> Orderings c m () | Result context with ordering |
Add ascendant ordering term.
:: forall (m :: Type -> Type) c t. Monad m | |
=> Record c t | Ordering terms to add |
-> Order | Order direction |
-> Orderings c m () | Result context with ordering |
Add ordering terms.
:: forall (m :: Type -> Type) c t. Monad m | |
=> Record c t | Ordering terms to add |
-> Order | Order direction |
-> Nulls | Order of null |
-> Orderings c m () | Result context with ordering |
Add ordering terms with null ordering.
data Orderings c (m :: Type -> Type) a #
Type to accumulate ordering context.
Type c
is ordering term record context type.
Instances
type Restrict = Restrictings Flat ConfigureQuery #
Restrict only monad type used from update statement and delete statement.
having :: MonadRestrict Aggregated m => Predicate Aggregated -> m () #
Add restriction to this aggregated query. Aggregated Record type version.
wheres :: MonadRestrict Flat m => Predicate Flat -> m () #
Add restriction to this not aggregated query.
on :: MonadQuery m => Predicate Flat -> m () #
Add restriction to last join. Record type version.
distinct :: MonadQuery m => m () #
Specify DISTINCT attribute to query context.
all' :: MonadQuery m => m () #
Specify ALL attribute to query context.
class (Functor m, Monad m) => MonadRestrict c (m :: Type -> Type) where #
Restrict context interface
Add restriction to this context.
Instances
MonadRestrict c m => MonadRestrict c (AggregatingSetT m) | Aggregated |
Defined in Database.Relational.Monad.Trans.Aggregating restrict :: Predicate c -> AggregatingSetT m () # | |
MonadRestrict c m => MonadRestrict c (Assignings r m) |
|
Defined in Database.Relational.Monad.Trans.Assigning restrict :: Predicate c -> Assignings r m () # | |
(Monad q, Functor q) => MonadRestrict c (Restrictings c q) |
|
Defined in Database.Relational.Monad.Trans.Restricting restrict :: Predicate c -> Restrictings c q () # | |
MonadRestrict rc m => MonadRestrict rc (Orderings c m) |
|
Defined in Database.Relational.Monad.Trans.Ordering |
class (Functor m, Monad m, MonadQualify ConfigureQuery m) => MonadQuery (m :: Type -> Type) where #
Query building interface.
query' :: Relation p r -> m (PlaceHolders p, Record Flat r) #
Join sub-query with place-holder parameter p
. query result is not Maybe
.
queryMaybe' :: Relation p r -> m (PlaceHolders p, Record Flat (Maybe r)) #
Join sub-query with place-holder parameter p
. Query result is Maybe
.
Instances
class (Functor q, Monad q, Functor m, Monad m) => MonadQualify (q :: Type -> Type) (m :: Type -> Type) #
Lift interface from base qualify monad.
Instances
class MonadQuery m => MonadAggregate (m :: Type -> Type) where #
Aggregated query building interface extends MonadQuery
.
:: Record Flat r | Record to add into group by |
-> m (Record Aggregated r) | Result context and aggregated record | Add GROUP BY term into context and get aggregated record. Non-traditional group-by version. |
Add GROUP BY term into context and get aggregated record.
:: AggregateKey (Record Aggregated r) | Key to aggretate for non-traditional group-by interface |
-> m (Record Aggregated r) | Result context and aggregated record |
Instances
MonadQuery m => MonadAggregate (AggregatingSetT m) | Aggregated query instance. |
Defined in Database.Relational.Monad.Trans.Aggregating groupBy :: Record Flat r -> AggregatingSetT m (Record Aggregated r) # groupBy' :: AggregateKey (Record Aggregated r) -> AggregatingSetT m (Record Aggregated r) # | |
MonadAggregate m => MonadAggregate (Orderings c m) |
|
Defined in Database.Relational.Monad.Trans.Ordering groupBy :: Record Flat r -> Orderings c m (Record Aggregated r) # groupBy' :: AggregateKey (Record Aggregated r) -> Orderings c m (Record Aggregated r) # | |
MonadAggregate m => MonadAggregate (Restrictings c m) | Restricted |
Defined in Database.Relational.Monad.Trans.Restricting groupBy :: Record Flat r -> Restrictings c m (Record Aggregated r) # groupBy' :: AggregateKey (Record Aggregated r) -> Restrictings c m (Record Aggregated r) # |
class Monad m => MonadPartition c (m :: Type -> Type) where #
Window specification building interface.
partitionBy :: Record c r -> m () #
Add PARTITION BY term into context.
Instances
Monad m => MonadPartition c (PartitioningSetT c m) | Partition clause instance |
Defined in Database.Relational.Monad.Trans.Aggregating partitionBy :: Record c r -> PartitioningSetT c m () # | |
MonadPartition c m => MonadPartition c (Orderings c m) |
|
Defined in Database.Relational.Monad.Trans.Ordering partitionBy :: Record c r -> Orderings c m () # |
:: PersistableWidth a | |
=> Record c (Maybe a) | |
-> Pi a (Maybe b) | Record path. |
-> Record c (Maybe b) | Narrower projected object. |
Same as (?!?)
. Use this operator like '(?? #foo) mayX'.
:: PersistableWidth a | |
=> Record c (Maybe a) | |
-> Pi a b | Record path |
-> Record c (Maybe b) | Narrower projected object. |
Same as (?!)
. Use this operator like '(? #foo) mayX'.
:: (PersistableWidth a, ProjectableFlattenMaybe (Maybe b) c) | |
=> Record cont (Maybe a) | |
-> Pi a b | Projection path |
-> Record cont c | Narrower flatten and projected object. |
Get narrower record with flatten leaf phantom Maybe types along with projection path.
:: (PersistableWidth a, ProjectableFlattenMaybe (Maybe b) c) | |
=> Record cont (Maybe a) | |
-> Pi a b | Projection path |
-> Record cont c |
Get narrower record with flatten leaf phantom Maybe types along with projection path.
:: PersistableWidth a | |
=> Record c a | Source |
-> Pi a b | Record path |
-> Record c b | Narrower projected object |
Get narrower record along with projection path.
some' :: (AggregatedContext ac, SqlContext ac) => Predicate Flat -> Record ac (Maybe Bool) #
Aggregation function SOME.
any' :: (AggregatedContext ac, SqlContext ac) => Predicate Flat -> Record ac (Maybe Bool) #
Aggregation function ANY.
every :: (AggregatedContext ac, SqlContext ac) => Predicate Flat -> Record ac (Maybe Bool) #
Aggregation function EVERY.
min' :: (Ord a, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac (Maybe a) #
Aggregation function MIN.
minMaybe :: (Ord a, AggregatedContext ac, SqlContext ac) => Record Flat (Maybe a) -> Record ac (Maybe a) #
Aggregation function MIN.
max' :: (Ord a, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac (Maybe a) #
Aggregation function MAX.
maxMaybe :: (Ord a, AggregatedContext ac, SqlContext ac) => Record Flat (Maybe a) -> Record ac (Maybe a) #
Aggregation function MAX.
avg :: (Num a, Fractional b, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac (Maybe b) #
Aggregation function AVG.
avgMaybe :: (Num a, Fractional b, AggregatedContext ac, SqlContext ac) => Record Flat (Maybe a) -> Record ac (Maybe b) #
Aggregation function AVG.
sum' :: (Num a, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac (Maybe a) #
Aggregation function SUM.
sumMaybe :: (Num a, AggregatedContext ac, SqlContext ac) => Record Flat (Maybe a) -> Record ac (Maybe a) #
Aggregation function SUM.
count :: (Integral b, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac b #
Aggregation function COUNT.
unsafeAggregateOp :: (AggregatedContext ac, SqlContext ac) => Keyword -> Record Flat a -> Record ac b #
Unsafely make aggregation uni-operator from SQL keyword.
(><) :: ProductIsoApplicative p => p a -> p b -> p (a, b) infixl 1 #
Binary operator the same as projectZip
.
projectZip :: ProductIsoApplicative p => p a -> p b -> p (a, b) #
Zipping projections.
placeholder :: (PersistableWidth t, SqlContext c, Monad m) => (Record c t -> m a) -> m (PlaceHolders t, a) #
Provide scoped placeholder and return its parameter object. Monadic version.
placeholder' :: (PersistableWidth t, SqlContext c) => (Record c t -> a) -> (PlaceHolders t, a) #
Provide scoped placeholder and return its parameter object.
pwPlaceholder :: SqlContext c => PersistableRecordWidth a -> (Record c a -> b) -> (PlaceHolders a, b) #
Provide scoped placeholder from width and return its parameter object.
unitPH :: PlaceHolders () #
No placeholder semantics. Same as unitPlaceHolder
unitPlaceHolder :: PlaceHolders () #
No placeholder semantics
unsafePlaceHolders :: PlaceHolders p #
Unsafely get placeholder parameter
unsafeAddPlaceHolders :: Functor f => f a -> f (PlaceHolders p, a) #
Unsafely add placeholder parameter to queries.
cumeDist :: Record OverWindow Double #
CUME_DIST() term.
percentRank :: Record OverWindow Double #
PERCENT_RANK() term.
rowNumber :: Integral a => Record OverWindow a #
ROW_NUMBER() term.
denseRank :: Integral a => Record OverWindow a #
DENSE_RANK() term.
rank :: Integral a => Record OverWindow a #
RANK() term.
fromMaybe :: (OperatorContext c, HasColumnConstraint NotNull r) => Record c r -> Record c (Maybe r) -> Record c r #
Operator from maybe type using record extended isNull
.
isJust :: (OperatorContext c, HasColumnConstraint NotNull r) => Record c (Maybe r) -> Predicate c #
Operator corresponding SQL NOT (... IS NULL) , and extended against record type.
isNothing :: (OperatorContext c, HasColumnConstraint NotNull r) => Record c (Maybe r) -> Predicate c #
Operator corresponding SQL IS NULL , and extended against record types.
in' :: OperatorContext c => Record c t -> RecordList (Record c) t -> Record c (Maybe Bool) infix 4 #
Binary operator corresponding SQL IN .
:: (OperatorContext c, PersistableWidth b) | |
=> Record c a | Record value to match |
-> [(Record c a, Record c (Maybe b))] | Each when clauses |
-> Record c (Maybe b) | Result record |
Null default version of case'
.
:: OperatorContext c | |
=> (Record c a, [(Record c a, Record c b)]) | Record value to match and each when clauses list |
-> Record c b | Else result record |
-> Record c b | Result record |
Uncurry version of case'
, and you can write like ... casesOrElse
` clause.
:: OperatorContext c | |
=> Record c a | Record value to match |
-> [(Record c a, Record c b)] | Each when clauses |
-> Record c b | Else result record |
-> Record c b | Result record |
Simple case operator correnponding SQL simple CASE. Like, CASE x WHEN v THEN a WHEN w THEN b ... ELSE c END
:: (OperatorContext c, PersistableWidth a) | |
=> [(Predicate c, Record c (Maybe a))] | Each when clauses |
-> Record c (Maybe a) | Result record |
Null default version of caseSearch
.
:: OperatorContext c | |
=> [(Predicate c, Record c a)] | Each when clauses |
-> Record c a | Else result record |
-> Record c a | Result record |
Same as caseSearch
, but you can write like list casesOrElse
clause.
:: OperatorContext c | |
=> [(Predicate c, Record c a)] | Each when clauses |
-> Record c a | Else result record |
-> Record c a | Result record |
Search case operator correnponding SQL search CASE. Like, CASE WHEN p0 THEN a WHEN p1 THEN b ... ELSE c END
showNumMaybe :: (SqlContext c, Num a, IsString b) => Record c (Maybe a) -> Record c (Maybe b) #
Unsafely show number into string-like type in records.
fromIntegralMaybe :: (SqlContext c, Integral a, Num b) => Record c (Maybe a) -> Record c (Maybe b) #
Number fromIntegral uni-operator.
negateMaybe :: (OperatorContext c, Num a) => Record c (Maybe a) -> Record c (Maybe a) #
Number negate uni-operator corresponding SQL -.
(?*?) :: (OperatorContext c, Num a) => Record c (Maybe a) -> Record c (Maybe a) -> Record c (Maybe a) infixl 7 #
Number operator corresponding SQL * .
(?/?) :: (OperatorContext c, Num a) => Record c (Maybe a) -> Record c (Maybe a) -> Record c (Maybe a) infixl 7 #
Number operator corresponding SQL /// .
(?-?) :: (OperatorContext c, Num a) => Record c (Maybe a) -> Record c (Maybe a) -> Record c (Maybe a) infixl 6 #
Number operator corresponding SQL - .
(?+?) :: (OperatorContext c, Num a) => Record c (Maybe a) -> Record c (Maybe a) -> Record c (Maybe a) infixl 6 #
Number operator corresponding SQL + .
showNum :: (SqlContext c, Num a, IsString b) => Record c a -> Record c b #
Unsafely show number into string-like type in records.
fromIntegral' :: (SqlContext c, Integral a, Num b) => Record c a -> Record c b #
Number fromIntegral uni-operator.
negate' :: (OperatorContext c, Num a) => Record c a -> Record c a #
Number negate uni-operator corresponding SQL -.
(.*.) :: (OperatorContext c, Num a) => Record c a -> Record c a -> Record c a infixl 7 #
Number operator corresponding SQL * .
(./.) :: (OperatorContext c, Num a) => Record c a -> Record c a -> Record c a infixl 7 #
Number operator corresponding SQL /// .
(.-.) :: (OperatorContext c, Num a) => Record c a -> Record c a -> Record c a infixl 6 #
Number operator corresponding SQL - .
(.+.) :: (OperatorContext c, Num a) => Record c a -> Record c a -> Record c a infixl 6 #
Number operator corresponding SQL + .
likeMaybe :: (OperatorContext c, IsString a, LiteralSQL a) => Record c (Maybe a) -> a -> Record c (Maybe Bool) infix 4 #
String-compare operator corresponding SQL LIKE . Maybe type version.
like :: (OperatorContext c, IsString a, LiteralSQL a) => Record c a -> a -> Record c (Maybe Bool) infix 4 #
String-compare operator corresponding SQL LIKE .
likeMaybe' :: (OperatorContext c, IsString a) => Record c (Maybe a) -> Record c (Maybe a) -> Record c (Maybe Bool) infix 4 #
String-compare operator corresponding SQL LIKE .
like' :: (OperatorContext c, IsString a) => Record c a -> Record c a -> Record c (Maybe Bool) infix 4 #
String-compare operator corresponding SQL LIKE .
(?||?) :: (OperatorContext c, IsString a) => Record c (Maybe a) -> Record c (Maybe a) -> Record c (Maybe a) infixl 5 #
Concatenate operator corresponding SQL || . Maybe type version.
(.||.) :: OperatorContext c => Record c a -> Record c a -> Record c a infixl 5 #
Concatenate operator corresponding SQL || .
exists :: OperatorContext c => RecordList (Record Exists) r -> Record c (Maybe Bool) #
Logical operator corresponding SQL EXISTS .
not' :: OperatorContext c => Record c (Maybe Bool) -> Record c (Maybe Bool) #
Logical operator corresponding SQL NOT .
or' :: OperatorContext c => Record c (Maybe Bool) -> Record c (Maybe Bool) -> Record c (Maybe Bool) infixr 2 #
Logical operator corresponding SQL OR .
and' :: OperatorContext c => Record c (Maybe Bool) -> Record c (Maybe Bool) -> Record c (Maybe Bool) infixr 3 #
Logical operator corresponding SQL AND .
(.<>.) :: OperatorContext c => Record c ft -> Record c ft -> Record c (Maybe Bool) infix 4 #
Compare operator corresponding SQL <> .
(.>=.) :: OperatorContext c => Record c ft -> Record c ft -> Record c (Maybe Bool) infix 4 #
Compare operator corresponding SQL >= .
(.>.) :: OperatorContext c => Record c ft -> Record c ft -> Record c (Maybe Bool) infix 4 #
Compare operator corresponding SQL > .
(.<=.) :: OperatorContext c => Record c ft -> Record c ft -> Record c (Maybe Bool) infix 4 #
Compare operator corresponding SQL <= .
(.<.) :: OperatorContext c => Record c ft -> Record c ft -> Record c (Maybe Bool) infix 4 #
Compare operator corresponding SQL < .
(.=.) :: OperatorContext c => Record c ft -> Record c ft -> Record c (Maybe Bool) infix 4 #
Compare operator corresponding SQL = .
unsafeBinOp :: SqlContext k => SqlBinOp -> Record k a -> Record k b -> Record k c #
Unsafely make binary operator for records from string binary operator.
unsafeUniOp :: SqlContext c2 => (Keyword -> Keyword) -> Record c1 a -> Record c2 b #
Unsafely make unary operator for records from SQL keyword.
Unsafely generate SQL expression string from record object.
String interface of unsafeShowSql'
.
unsafeShowSql' :: Record c a -> StringSQL #
Unsafely generate SQL expression term from record object.
values :: (LiteralSQL t, OperatorContext c) => [t] -> RecordList (Record c) t #
RecordList with polymorphic type of SQL set value from Haskell list.
valueFalse :: OperatorContext c => Record c (Maybe Bool) #
Record with polymorphic type of SQL false value.
valueTrue :: OperatorContext c => Record c (Maybe Bool) #
Record with polymorphic type of SQL true value.
value :: (LiteralSQL t, OperatorContext c) => t -> Record c t #
Generate record with polymorphic type of SQL constant values from Haskell value.
nothing :: (OperatorContext c, SqlContext c, PersistableWidth a) => Record c (Maybe a) #
Record with polymorphic phantom type of SQL null value. Semantics of comparing is unsafe.
unsafeProjectSql :: SqlContext c => String -> Record c t #
Unsafely Project single SQL string. String interface of unsafeProjectSql''
.
unsafeProjectSql' :: SqlContext c => StringSQL -> Record c t #
Unsafely Project single SQL term.
class ProjectableMaybe (p :: Type -> Type) where #
Interface to control Maybe
of phantom type in records.
Cast record phantom type into Maybe
.
flattenMaybe :: p (Maybe (Maybe a)) -> p (Maybe a) #
Compose nested Maybe
phantom type on record.
Instances
ProjectableMaybe PlaceHolders | Control phantom |
Defined in Database.Relational.Projectable just :: PlaceHolders a -> PlaceHolders (Maybe a) # flattenMaybe :: PlaceHolders (Maybe (Maybe a)) -> PlaceHolders (Maybe a) # | |
ProjectableMaybe (Record c) | |
class ProjectableFlattenMaybe a b where #
Interface to compose phantom Maybe
nested type.
flatten :: ProjectableMaybe p => p a -> p b #
Instances
ProjectableFlattenMaybe (Maybe a) b => ProjectableFlattenMaybe (Maybe (Maybe a)) b | Compose |
Defined in Database.Relational.Projectable flatten :: ProjectableMaybe p => p (Maybe (Maybe a)) -> p b # | |
ProjectableFlattenMaybe (Maybe a) (Maybe a) | Not |
Defined in Database.Relational.Projectable flatten :: ProjectableMaybe p => p (Maybe a) -> p (Maybe a) # |
snd' :: (PersistableWidth a, PersistableWidth b) => Pi (a, b) b #
Projection path for snd of tuple.
fst' :: (PersistableWidth a, PersistableWidth b) => Pi (a, b) a #
Projection path for fst of tuple.
tuplePi7_6' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6, PersistableWidth a7) => Pi (a1, a2, a3, a4, a5, a6, a7) a7 #
tuplePi7_5' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6, PersistableWidth a7) => Pi (a1, a2, a3, a4, a5, a6, a7) a6 #
tuplePi7_4' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6, PersistableWidth a7) => Pi (a1, a2, a3, a4, a5, a6, a7) a5 #
tuplePi7_3' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6, PersistableWidth a7) => Pi (a1, a2, a3, a4, a5, a6, a7) a4 #
tuplePi7_2' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6, PersistableWidth a7) => Pi (a1, a2, a3, a4, a5, a6, a7) a3 #
tuplePi7_1' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6, PersistableWidth a7) => Pi (a1, a2, a3, a4, a5, a6, a7) a2 #
tuplePi7_0' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6, PersistableWidth a7) => Pi (a1, a2, a3, a4, a5, a6, a7) a1 #
tuplePi6_5' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6) => Pi (a1, a2, a3, a4, a5, a6) a6 #
tuplePi6_4' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6) => Pi (a1, a2, a3, a4, a5, a6) a5 #
tuplePi6_3' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6) => Pi (a1, a2, a3, a4, a5, a6) a4 #
tuplePi6_2' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6) => Pi (a1, a2, a3, a4, a5, a6) a3 #
tuplePi6_1' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6) => Pi (a1, a2, a3, a4, a5, a6) a2 #
tuplePi6_0' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5, PersistableWidth a6) => Pi (a1, a2, a3, a4, a5, a6) a1 #
tuplePi5_4' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5) => Pi (a1, a2, a3, a4, a5) a5 #
tuplePi5_3' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5) => Pi (a1, a2, a3, a4, a5) a4 #
tuplePi5_2' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5) => Pi (a1, a2, a3, a4, a5) a3 #
tuplePi5_1' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5) => Pi (a1, a2, a3, a4, a5) a2 #
tuplePi5_0' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4, PersistableWidth a5) => Pi (a1, a2, a3, a4, a5) a1 #
tuplePi4_3' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4) => Pi (a1, a2, a3, a4) a4 #
tuplePi4_2' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4) => Pi (a1, a2, a3, a4) a3 #
tuplePi4_1' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4) => Pi (a1, a2, a3, a4) a2 #
tuplePi4_0' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3, PersistableWidth a4) => Pi (a1, a2, a3, a4) a1 #
tuplePi3_2' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3) => Pi (a1, a2, a3) a3 #
tuplePi3_1' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3) => Pi (a1, a2, a3) a2 #
tuplePi3_0' :: (PersistableWidth a1, PersistableWidth a2, PersistableWidth a3) => Pi (a1, a2, a3) a1 #
tuplePi2_1' :: (PersistableWidth a1, PersistableWidth a2) => Pi (a1, a2) a2 #
tuplePi2_0' :: (PersistableWidth a1, PersistableWidth a2) => Pi (a1, a2) a1 #
Generate update SQL specified by single key.
type QuerySuffix = [Keyword] #
Type for query suffix words
list :: [p t] -> RecordList p t #
Make projected record list from Record
list.
data RecordList (p :: Type -> Type) t #
Projected record list type for row list.
Phantom typed table type
class PersistableWidth r => TableDerivable r where #
Inference rule of Table
existence.
derivedTable :: Table r #
Instances
sqlFromRelation :: Relation p r -> StringSQL #
SQL string from Relation
.
sqlFromRelationWith :: Relation p r -> Config -> StringSQL #
Generate SQL string from Relation
with configuration.
leftPh :: Relation (p, ()) r -> Relation p r #
Simplify placeholder type applying right identity element.
rightPh :: Relation ((), p) r -> Relation p r #
Simplify placeholder type applying left identity element.
relationWidth :: Relation p r -> PersistableRecordWidth r #
PersistableRecordWidth
of Relation
type.
untypeRelation :: Relation p r -> ConfigureQuery SubQuery #
Sub-query Qualify monad from relation.
unsafeTypeRelation :: ConfigureQuery SubQuery -> Relation p r #
Unsafely type qualified subquery into record typed relation type.
askConfig :: ConfigureQuery Config #
Read configuration.
qualifyQuery :: a -> ConfigureQuery (Qualified a) #
Get qualifyed table form query.
configureQuery :: ConfigureQuery q -> Config -> q #
Run ConfigureQuery
monad with initial state to get only result.
type ConfigureQuery = Qualify (QueryConfig Identity) #
Thin monad type for untyped structure.
Relation type with place-holder parameter p
and query result type r
.
class SqlContext c where #
Interface to project SQL terms unsafely.
unsafeProjectSqlTerms :: [StringSQL] -> Record c t #
Unsafely project from SQL expression terms.
data PlaceHolders p #
Placeholder parameter type which has real parameter type argument p
.
Instances
ProjectableMaybe PlaceHolders | Control phantom |
Defined in Database.Relational.Projectable just :: PlaceHolders a -> PlaceHolders (Maybe a) # flattenMaybe :: PlaceHolders (Maybe (Maybe a)) -> PlaceHolders (Maybe a) # |
Order direction. Ascendant or Descendant.
Order of null.
data AggregateKey a #
Typeful aggregate element.
Sub-query type
Phantom typed record. Projected into Haskell record type t
.
Instances
ProjectableMaybe (Record c) | |
Show (Record c t) | |
class PersistableWidth ct => ScalarDegree ct #
Constraint which represents scalar degree.
Instances
ScalarDegree ct => ScalarDegree (Maybe ct) | |
Defined in Database.Relational.Scalar |
showConstantTermsSQL :: ShowConstantTermsSQL a => a -> [StringSQL] #
Deprecated.
showConstantTermsSQL' :: ShowConstantTermsSQL a => a -> DList StringSQL #
showLiteral :: LiteralSQL a => a -> [StringSQL] #
Convert from haskell record to SQL literal row-value.
class LiteralSQL a where #
LiteralSQL
a
is implicit rule to derive function to convert
from haskell record type a
into SQL literal row-value.
Generic programming (https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#generic-programming)
with default signature is available for LiteralSQL
class,
so you can make instance like below:
{-# LANGUAGE DeriveGeneric #-} import GHC.Generics (Generic) -- data Foo = Foo { ... } deriving Generic instance LiteralSQL Foo
Nothing
showLiteral' :: a -> DList StringSQL #
Instances
type ShowConstantTermsSQL = LiteralSQL #
Deprecated.
derivedUniqueKey :: HasConstraintKey Primary r ct => Key Unique r ct #
projectionKey :: Key c r ct -> Pi r ct #
Get projection path proof object from constraint Key
.
tableConstraint :: Key c r ct -> KeyConstraint c r #
Get table constraint KeyConstraint
proof object from constraint Key
.
class PersistableWidth ct => HasConstraintKey c r ct where #
Constraint Key
inference interface.
constraintKey :: Key c r ct #
Infer constraint key.
(<?.?>) :: Pi a (Maybe b) -> Pi b (Maybe c) -> Pi a (Maybe c) infixl 8 #
Compose projection path. Maybe
phantom functors are join
-ed like >=>
.
expandIndexes :: PersistableWidth a => Pi a b -> [Int] #
Expand indexes from key. Inferred width version.
expandIndexes' :: PersistableRecordWidth a -> Pi a b -> [Int] #
Expand indexes from key.
Projection path from type r0
into type r1
.
This type also indicate key object which type is r1
for record type r0
.
Instances
Category Pi | |
ProductIsoApplicative (Pi a) | Compose projection path |
Defined in Database.Relational.Pi.Unsafe | |
ProductIsoFunctor (Pi a) | Map projection path |
Defined in Database.Relational.Pi.Unsafe (|$|) :: ProductConstructor (a0 -> b) => (a0 -> b) -> Pi a a0 -> Pi a b # | |
ProductIsoEmpty (Pi a) () | |
PersistableWidth r0 => Show (Pi r0 r1) | |
data Aggregated #
Type tag for aggregated query
data OverWindow #
Type tag for window function building
Type tag for normal aggregatings set
Instances
defaultConfig :: Config #
Default configuration of Config
.
To change some behaviour of relational-query,
use record update syntax:
defaultConfig { productUnitSupport =PUSupported
, chunksInsertSize = 256 , schemaNameMode =SchemaQualified
, normalizedTableName = True , addQueryTableAliasAS = False , addModifyTableAliasAS = False , enableWarning = True , verboseAsCompilerWarning = False , disableOverloadedProjection = False , disableSpecializedProjection = False , identifierQuotation =NoQuotation
, nameConfig = defaultNameConfig { recordConfig =defaultNameConfig
, relationVarName = \schema table ->varCamelcaseName
$ table ++ "_" ++ scheme -- ^ append the table name after the schema name. e.g. "schemaTable" } }
defaultNameConfig :: NameConfig #
Default implementation of NameConfig
type.
data NameConfig #
NameConfig
type to customize names of expanded templates.
Instances
Show NameConfig | |
Defined in Database.Relational.Internal.Config showsPrec :: Int -> NameConfig -> ShowS # show :: NameConfig -> String # showList :: [NameConfig] -> ShowS # |
data ProductUnitSupport #
Unit of product is supported or not.
Instances
Show ProductUnitSupport | |
Defined in Database.Relational.Internal.Config showsPrec :: Int -> ProductUnitSupport -> ShowS # show :: ProductUnitSupport -> String # showList :: [ProductUnitSupport] -> ShowS # |
data SchemaNameMode #
Schema name qualify mode in SQL string.
SchemaQualified | Schema qualified table name in SQL string |
SchemaNotQualified | Not qualified table name in SQL string |
Instances
Show SchemaNameMode | |
Defined in Database.Relational.Internal.Config showsPrec :: Int -> SchemaNameMode -> ShowS # show :: SchemaNameMode -> String # showList :: [SchemaNameMode] -> ShowS # | |
Eq SchemaNameMode | |
Defined in Database.Relational.Internal.Config (==) :: SchemaNameMode -> SchemaNameMode -> Bool # (/=) :: SchemaNameMode -> SchemaNameMode -> Bool # |
data IdentifierQuotation #
Configuration for quotation of identifiers of SQL.
Instances
Show IdentifierQuotation | |
Defined in Database.Relational.Internal.Config showsPrec :: Int -> IdentifierQuotation -> ShowS # show :: IdentifierQuotation -> String # showList :: [IdentifierQuotation] -> ShowS # |
Configuration type.
insertValue :: TableDerivable r => Register r (PlaceHolders p) -> Insert p Source #
insertValueNoPH :: TableDerivable r => Register r () -> Insert () Source #
insertQuery :: TableDerivable r => Pi r r' -> Relation p r' -> InsertQuery p Source #
Make InsertQuery
from derived table, Pi
and Relation
.
update :: TableDerivable r => (Record Flat r -> Assign r (PlaceHolders p)) -> Update p Source #
updateNoPH :: TableDerivable r => (Record Flat r -> Assign r ()) -> Update () Source #
delete :: TableDerivable r => (Record Flat r -> Restrict (PlaceHolders p)) -> Delete p Source #
deleteNoPH :: TableDerivable r => (Record Flat r -> Restrict ()) -> Delete () Source #
Make Delete
from defaultConfig
, derived table and Restrict
computation with no(unit) placeholder.