| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Napkin.Run.Effects.Hooks
Synopsis
- data CountTolerance
- data CompareCount
- data WithinSet a
- = FromToRange a a
- | ValuesList [a]
- type BoundToRelation a = Ref Relation -> a
- pattern ApproxEqualRelative :: Scientific -> CompareCount
- pattern ApproxEqualAbsolute :: Scientific -> CompareCount
- assertAllValuesWithin :: forall {k} (b :: k) (r :: EffectRow) a. (GlobalAssert b r, Val a) => Relation -> WithinSet a -> BoundToRelation (Selected SExp) -> Sem r ()
- assertAllValuesWithinT :: forall {k} (b :: k) (r :: EffectRow) a. (Assert b r, Val a) => WithinSet a -> BoundToRelation (Selected SExp) -> Sem r ()
- assertAnswerConst :: forall {k} a (b :: k) (r :: EffectRow). (GlobalAssert b r, Real a, Show a, Val a) => CompareCount -> a -> Query -> Sem r ()
- assertAnswerConstT :: forall {k} a (b :: k) (r :: EffectRow) q. (Assert b r, Real a, Show a, Val a) => CompareCount -> a -> Q q -> Sem r ()
- assertAnswerEq :: forall {k} a (b :: k) (r :: EffectRow). (Eq a, GlobalAssert b r, Show a, Val a) => Query -> a -> Sem r ()
- assertAnswerEqT :: forall {k} a (b :: k) (r :: EffectRow) q. (Assert b r, Eq a, Show a, Val a) => Q q -> a -> Sem r ()
- assertAnswers :: forall {k} a (b :: k) (r :: EffectRow). (Buildable a, GlobalAssert b r, Real a, Val a) => CompareCount -> Query -> Query -> Sem r ()
- assertAnyPresent :: forall {k} (b :: k) (r :: EffectRow). GlobalAssert b r => BoundToRelation SExp -> Relation -> Sem r ()
- assertAnyPresentT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => BoundToRelation SExp -> Sem r ()
- assertAnyValuesWithin :: forall {k} (b :: k) (r :: EffectRow) a. (GlobalAssert b r, Val a) => Relation -> WithinSet a -> BoundToRelation (Selected SExp) -> Sem r ()
- assertAnyValuesWithinT :: forall {k} (b :: k) (r :: EffectRow) a. (Assert b r, Val a) => WithinSet a -> BoundToRelation (Selected SExp) -> Sem r ()
- assertCardinalities :: forall {k} (b :: k) (r :: EffectRow). GlobalAssert b r => CompareCount -> Relation -> BoundToRelation (Selected SExp) -> Relation -> BoundToRelation (Selected SExp) -> Sem r ()
- assertCardinalitiesT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => CompareCount -> BoundToRelation (Selected SExp) -> Relation -> BoundToRelation (Selected SExp) -> Sem r ()
- assertCount :: forall {k} (b :: k) (r :: EffectRow). GlobalAssert b r => CompareCount -> Relation -> Relation -> Sem r ()
- assertCountConst :: forall {k} (b :: k) (r :: EffectRow). GlobalAssert b r => CompareCount -> Integer -> Relation -> Sem r ()
- assertCountConstT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => CompareCount -> Integer -> Sem r ()
- assertCountT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => CompareCount -> Relation -> Sem r ()
- assertExpression :: forall {k} (b :: k) (r :: EffectRow). GlobalAssert b r => Relation -> BoundToRelation (Selected SExp) -> Sem r ()
- assertExpressionT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => BoundToRelation (Selected SExp) -> Sem r ()
- assertNotNull :: forall {k} (b :: k) (r :: EffectRow). GlobalAssert b r => Relation -> BoundToRelation (NonEmpty (Selected SExp)) -> Sem r ()
- assertNotNullT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => BoundToRelation (NonEmpty (Selected SExp)) -> Sem r ()
- assertNoValuesWithin :: forall {k} (b :: k) (r :: EffectRow) a. (GlobalAssert b r, Val a) => Relation -> WithinSet a -> BoundToRelation (Selected SExp) -> Sem r ()
- assertNoValuesWithinT :: forall {k} (b :: k) (r :: EffectRow) a. (Assert b r, Val a) => WithinSet a -> BoundToRelation (Selected SExp) -> Sem r ()
- assertUniqueBy :: forall {k} (b :: k) (r :: EffectRow). GlobalAssert b r => Relation -> BoundToRelation (NonEmpty (Selected SExp)) -> Sem r ()
- assertUniqueByCap :: forall {k} (b :: k) (r :: EffectRow). GlobalAssert b r => CountTolerance -> Relation -> BoundToRelation [Selected SExp] -> Sem r ()
- assertUniqueByCapT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => CountTolerance -> BoundToRelation [Selected SExp] -> Sem r ()
- assertUniqueByT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => BoundToRelation (NonEmpty (Selected SExp)) -> Sem r ()
- assertUniqueByWhere :: forall {k} (b :: k) (r :: EffectRow). GlobalAssert b r => Relation -> BoundToRelation PredicateSExp -> BoundToRelation (NonEmpty (Selected SExp)) -> Sem r ()
- assertUniqueByWhereT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => BoundToRelation PredicateSExp -> BoundToRelation (NonEmpty (Selected SExp)) -> Sem r ()
- assertMultipleCardinalities :: forall {k} (b :: k) (r :: EffectRow). GlobalAssert b r => CompareCount -> Relation -> BoundToRelation (Selected SExp) -> [(Relation, BoundToRelation (Selected SExp))] -> Sem r ()
- assertMultipleCardinalitiesT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => CompareCount -> BoundToRelation (Selected SExp) -> [(Relation, BoundToRelation (Selected SExp))] -> Sem r ()
- assertMultipleColumnsCardinalities :: forall {k} (b :: k) (r :: EffectRow). GlobalAssert b r => CompareCount -> Relation -> BoundToRelation [Selected SExp] -> Relation -> BoundToRelation [Selected SExp] -> Sem r ()
- assertZeroCasesOf :: forall {k} (b :: k) (r :: EffectRow). Assert b r => Relation -> BoundToRelation (Selected SExp) -> Sem r ()
- assertZeroCasesOfT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => BoundToRelation (Selected SExp) -> Sem r ()
Documentation
data CountTolerance #
Constructors
| Absolute Scientific | |
| Relative Scientific |
Instances
| Show CountTolerance # | |
Defined in Napkin.Run.Effects.Hooks.Types Methods showsPrec :: Int -> CountTolerance -> ShowS # show :: CountTolerance -> String # showList :: [CountTolerance] -> ShowS # | |
| Eq CountTolerance # | |
Defined in Napkin.Run.Effects.Hooks.Types Methods (==) :: CountTolerance -> CountTolerance -> Bool # (/=) :: CountTolerance -> CountTolerance -> Bool # | |
data CompareCount #
Instances
| Show CompareCount # | |
Defined in Napkin.Run.Effects.Hooks.Types Methods showsPrec :: Int -> CompareCount -> ShowS # show :: CompareCount -> String # showList :: [CompareCount] -> ShowS # | |
| Eq CompareCount # | |
Defined in Napkin.Run.Effects.Hooks.Types | |
Constructors
| FromToRange a a | |
| ValuesList [a] |
Instances
| Data a => Data (WithinSet a) # | |||||
Defined in Napkin.Run.Effects.Hooks.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> WithinSet a -> c (WithinSet a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (WithinSet a) # toConstr :: WithinSet a -> Constr # dataTypeOf :: WithinSet a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (WithinSet a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (WithinSet a)) # gmapT :: (forall b. Data b => b -> b) -> WithinSet a -> WithinSet a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> WithinSet a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> WithinSet a -> r # gmapQ :: (forall d. Data d => d -> u) -> WithinSet a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> WithinSet a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> WithinSet a -> m (WithinSet a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> WithinSet a -> m (WithinSet a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> WithinSet a -> m (WithinSet a) # | |||||
| Generic (WithinSet a) # | |||||
Defined in Napkin.Run.Effects.Hooks.Types Associated Types
| |||||
| Show a => Show (WithinSet a) # | |||||
| Eq a => Eq (WithinSet a) # | |||||
| type Rep (WithinSet a) # | |||||
Defined in Napkin.Run.Effects.Hooks.Types type Rep (WithinSet a) = D1 ('MetaData "WithinSet" "Napkin.Run.Effects.Hooks.Types" "napkin-api-2.0.0-DLCJ7X7TSiWHqRCAUru88E" 'False) (C1 ('MetaCons "FromToRange" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "ValuesList" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [a]))) | |||||
type BoundToRelation a = Ref Relation -> a #
pattern ApproxEqualRelative :: Scientific -> CompareCount #
pattern ApproxEqualAbsolute :: Scientific -> CompareCount #
assertAllValuesWithin :: forall {k} (b :: k) (r :: EffectRow) a. (GlobalAssert b r, Val a) => Relation -> WithinSet a -> BoundToRelation (Selected SExp) -> Sem r () #
Fail if the table column contains some values beyond the specified (inclusive) range.
assertAllValuesWithinT :: forall {k} (b :: k) (r :: EffectRow) a. (Assert b r, Val a) => WithinSet a -> BoundToRelation (Selected SExp) -> Sem r () #
Fail if the target column contains some values beyond the specified (inclusive) range.
assertAnswerConst :: forall {k} a (b :: k) (r :: EffectRow). (GlobalAssert b r, Real a, Show a, Val a) => CompareCount -> a -> Query -> Sem r () #
Compares result of a query against a constant value using comparison over Real numbers, fails if check does not hold.
assertAnswerConstT :: forall {k} a (b :: k) (r :: EffectRow) q. (Assert b r, Real a, Show a, Val a) => CompareCount -> a -> Q q -> Sem r () #
Compares result of a query against a constant value using comparison over Real numbers, fails if check does not hold.
assertAnswerEq :: forall {k} a (b :: k) (r :: EffectRow). (Eq a, GlobalAssert b r, Show a, Val a) => Query -> a -> Sem r () #
Compares result of a query against a constant value using comparison over Eq constraint, fails if check does not hold.
assertAnswerEqT :: forall {k} a (b :: k) (r :: EffectRow) q. (Assert b r, Eq a, Show a, Val a) => Q q -> a -> Sem r () #
Compares result of a query against a constant value using comparison over Eq constraint, fails if check does not hold.
assertAnswers :: forall {k} a (b :: k) (r :: EffectRow). (Buildable a, GlobalAssert b r, Real a, Val a) => CompareCount -> Query -> Query -> Sem r () #
Compares result of a two queries, fails if check does not hold.
assertAnyPresent :: forall {k} (b :: k) (r :: EffectRow). GlobalAssert b r => BoundToRelation SExp -> Relation -> Sem r () #
Checks if any values are present in given column.
assertAnyPresentT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => BoundToRelation SExp -> Sem r () #
Checks if any values are present in given column.
assertAnyValuesWithin :: forall {k} (b :: k) (r :: EffectRow) a. (GlobalAssert b r, Val a) => Relation -> WithinSet a -> BoundToRelation (Selected SExp) -> Sem r () #
Fail if the table column contains no values from the specified (inclusive) range.
assertAnyValuesWithinT :: forall {k} (b :: k) (r :: EffectRow) a. (Assert b r, Val a) => WithinSet a -> BoundToRelation (Selected SExp) -> Sem r () #
Fail if the target column contains no values from the specified (inclusive) range.
assertCardinalities :: forall {k} (b :: k) (r :: EffectRow). GlobalAssert b r => CompareCount -> Relation -> BoundToRelation (Selected SExp) -> Relation -> BoundToRelation (Selected SExp) -> Sem r () #
Checks the cardinalities of two columns that may be sourced from different tables.
assertCardinalitiesT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => CompareCount -> BoundToRelation (Selected SExp) -> Relation -> BoundToRelation (Selected SExp) -> Sem r () #
Checks the cardinalities of two columns that may be sourced from different tables.
assertCount :: forall {k} (b :: k) (r :: EffectRow). GlobalAssert b r => CompareCount -> Relation -> Relation -> Sem r () #
Compares counts of two relations, fails if check does not hold.
assertCountConst :: forall {k} (b :: k) (r :: EffectRow). GlobalAssert b r => CompareCount -> Integer -> Relation -> Sem r () #
Compares counts of relation against a constant value, fails if check does not hold.
assertCountConstT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => CompareCount -> Integer -> Sem r () #
Compares counts of target against a constant value, fails if check does not hold.
assertCountT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => CompareCount -> Relation -> Sem r () #
Compares counts of target and a relation, fails if check does not hold.
assertExpression :: forall {k} (b :: k) (r :: EffectRow). GlobalAssert b r => Relation -> BoundToRelation (Selected SExp) -> Sem r () #
Assert expression is true
assertExpressionT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => BoundToRelation (Selected SExp) -> Sem r () #
Assert expression is true
assertNotNull :: forall {k} (b :: k) (r :: EffectRow). GlobalAssert b r => Relation -> BoundToRelation (NonEmpty (Selected SExp)) -> Sem r () #
Fail if any of the given expressions/columns have any NULL values.
assertNotNullT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => BoundToRelation (NonEmpty (Selected SExp)) -> Sem r () #
Fail if any of the given expressions/columns have any NULL values.
assertNoValuesWithin :: forall {k} (b :: k) (r :: EffectRow) a. (GlobalAssert b r, Val a) => Relation -> WithinSet a -> BoundToRelation (Selected SExp) -> Sem r () #
Fail if the table column contains some values within the specified (inclusive) range.
assertNoValuesWithinT :: forall {k} (b :: k) (r :: EffectRow) a. (Assert b r, Val a) => WithinSet a -> BoundToRelation (Selected SExp) -> Sem r () #
Fail if the target column contains some values within the specified (inclusive) range.
assertUniqueBy :: forall {k} (b :: k) (r :: EffectRow). GlobalAssert b r => Relation -> BoundToRelation (NonEmpty (Selected SExp)) -> Sem r () #
Fail if there are non-unique rows in the result.
assertUniqueByCap :: forall {k} (b :: k) (r :: EffectRow). GlobalAssert b r => CountTolerance -> Relation -> BoundToRelation [Selected SExp] -> Sem r () #
Checks if number of duplicate rows in a table is within certain tolerance.
assertUniqueByCapT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => CountTolerance -> BoundToRelation [Selected SExp] -> Sem r () #
Checks if number of duplicate rows in a target is within certain tolerance.
assertUniqueByT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => BoundToRelation (NonEmpty (Selected SExp)) -> Sem r () #
Fail if there are non-unique rows in the result.
assertUniqueByWhere :: forall {k} (b :: k) (r :: EffectRow). GlobalAssert b r => Relation -> BoundToRelation PredicateSExp -> BoundToRelation (NonEmpty (Selected SExp)) -> Sem r () #
Fail if there are non-unique rows in the result for the multiple predicate and column names.
assertUniqueByWhereT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => BoundToRelation PredicateSExp -> BoundToRelation (NonEmpty (Selected SExp)) -> Sem r () #
Fail if there are non-unique rows in the result for the multiple predicate and column names.
assertMultipleCardinalities :: forall {k} (b :: k) (r :: EffectRow). GlobalAssert b r => CompareCount -> Relation -> BoundToRelation (Selected SExp) -> [(Relation, BoundToRelation (Selected SExp))] -> Sem r () #
Checks the cardinalities of multiple columns that may be sourced from many different tables.
assertMultipleCardinalitiesT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => CompareCount -> BoundToRelation (Selected SExp) -> [(Relation, BoundToRelation (Selected SExp))] -> Sem r () #
Checks the cardinalities of multiple columns that may be sourced from many different tables.
assertMultipleColumnsCardinalities :: forall {k} (b :: k) (r :: EffectRow). GlobalAssert b r => CompareCount -> Relation -> BoundToRelation [Selected SExp] -> Relation -> BoundToRelation [Selected SExp] -> Sem r () #
Checks the cardinalities of two columns that may be sourced from different tables.
assertZeroCasesOf :: forall {k} (b :: k) (r :: EffectRow). Assert b r => Relation -> BoundToRelation (Selected SExp) -> Sem r () #
Assert there are zero cases for the given expression.
assertZeroCasesOfT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => BoundToRelation (Selected SExp) -> Sem r () #
Assert there are zero cases for the given expression.