Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data CountTolerance
- data CompareCount
- data WithinSet a
- = FromToRange a a
- | ValuesList [a]
- pattern ApproxEqualRelative :: Scientific -> CompareCount
- pattern ApproxEqualAbsolute :: Scientific -> CompareCount
- assertCount :: HookCommon b r => CompareCount -> Relation -> Relation -> Sem r ()
- assertCountConst :: HookCommon b r => CompareCount -> Relation -> Integer -> Sem r ()
- assertAnswers :: forall a b r. (Show a, Real a, Val a, HookCommon b r) => CompareCount -> Query -> Query -> Sem r ()
- assertAnswerConst :: forall a b r. (Show a, Real a, Val a, HookCommon b r) => CompareCount -> Query -> a -> Sem r ()
- assertAllValuesWithin :: (HookCommon b r, Val a) => Relation -> SExp -> WithinSet a -> Sem r ()
- assertAnyValuesWithin :: (HookCommon b r, Val a) => Relation -> SExp -> WithinSet a -> Sem r ()
- assertNoValuesWithin :: (HookCommon b r, Val a) => Relation -> SExp -> WithinSet a -> Sem r ()
- assertUniqueByWhere :: HookCommon b r => Relation -> PredicateSExp -> [Selected SExp] -> Sem r ()
- assertExpression :: HookCommon b r => Relation -> SExp -> Sem r ()
- assertNotNull :: (HookCommon b r, Member SqlRender r) => Relation -> [SExp] -> Sem r ()
- assertUniqueByCap :: HookCommon b r => CountTolerance -> Relation -> [Selected SExp] -> Sem r ()
- assertAnyPresent :: HookCommon b r => SExp -> Relation -> Sem r ()
- assertUniqueBy :: HookCommon b r => Relation -> [Selected SExp] -> Sem r ()
- runProcessHook :: Member (Embed IO) r => String -> [String] -> Sem r ()
- assertCardinalities :: HookCommon b r => CompareCount -> Relation -> SExp -> Relation -> SExp -> Sem r ()
Documentation
data CountTolerance #
Instances
Eq CountTolerance # | |
Defined in Napkin.Run.Effects.Hooks.Types (==) :: CountTolerance -> CountTolerance -> Bool # (/=) :: CountTolerance -> CountTolerance -> Bool # | |
Show CountTolerance # | |
Defined in Napkin.Run.Effects.Hooks.Types showsPrec :: Int -> CountTolerance -> ShowS # show :: CountTolerance -> String # showList :: [CountTolerance] -> ShowS # |
data CompareCount #
Instances
Eq CompareCount # | |
Defined in Napkin.Run.Effects.Hooks.Types (==) :: CompareCount -> CompareCount -> Bool # (/=) :: CompareCount -> CompareCount -> Bool # | |
Show CompareCount # | |
Defined in Napkin.Run.Effects.Hooks.Types showsPrec :: Int -> CompareCount -> ShowS # show :: CompareCount -> String # showList :: [CompareCount] -> ShowS # |
FromToRange a a | |
ValuesList [a] |
Instances
Eq a => Eq (WithinSet a) # | |
Show a => Show (WithinSet a) # | |
Generic (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-0.5.13-8705pBGlgyp7AIaYGNE2fM" '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]))) |
pattern ApproxEqualRelative :: Scientific -> CompareCount #
pattern ApproxEqualAbsolute :: Scientific -> CompareCount #
assertCount :: HookCommon b r => CompareCount -> Relation -> Relation -> Sem r () #
Compares counts of two relations, fails if check does not hold.
assertCountConst :: HookCommon b r => CompareCount -> Relation -> Integer -> Sem r () #
Compares counts of relation against a constant value, fails if check does not hold.
assertAnswers :: forall a b r. (Show a, Real a, Val a, HookCommon b r) => CompareCount -> Query -> Query -> Sem r () #
Compares result of a two queries, fails if check does not hold.
assertAnswerConst :: forall a b r. (Show a, Real a, Val a, HookCommon b r) => CompareCount -> Query -> a -> Sem r () #
Compares result of a query against a constant value, fails if check does not hold.
assertAllValuesWithin :: (HookCommon b r, Val a) => Relation -> SExp -> WithinSet a -> Sem r () #
Fail if the table column contains some values beyond the specified (inclusive) range.
assertAnyValuesWithin :: (HookCommon b r, Val a) => Relation -> SExp -> WithinSet a -> Sem r () #
Fail if the table column contains no values from the specified (inclusive) range.
assertNoValuesWithin :: (HookCommon b r, Val a) => Relation -> SExp -> WithinSet a -> Sem r () #
Fail if the table column contains some values within the specified (inclusive) range.
assertUniqueByWhere :: HookCommon b r => Relation -> PredicateSExp -> [Selected SExp] -> Sem r () #
Fail if there are non-unique rows in the result for the multiple predicate and column names.
assertExpression :: HookCommon b r => Relation -> SExp -> Sem r () #
Assert expression is true
assertNotNull :: (HookCommon b r, Member SqlRender r) => Relation -> [SExp] -> Sem r () #
Fail if any of the given expressions/columns have any NULL values
assertUniqueByCap :: HookCommon b r => CountTolerance -> Relation -> [Selected SExp] -> Sem r () #
Checks if number of duplicate rows in a table is within certain tolerance.
assertAnyPresent :: HookCommon b r => SExp -> Relation -> Sem r () #
Checks if any values are present in given column.
assertUniqueBy :: HookCommon b r => Relation -> [Selected SExp] -> Sem r () #
Fail if there are non-unique rows in the result.
assertCardinalities :: HookCommon b r => CompareCount -> Relation -> SExp -> Relation -> SExp -> Sem r () #
Checks the cardinalities of two columns that may be sourced from different tables.