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 r => CompareCount -> Relation -> Relation -> Sem r ()
- assertCountConst :: HookCommon r => CompareCount -> Relation -> Integer -> Sem r ()
- assertAnswers :: forall a r. (Show a, Real a, Val a, HookCommon r) => CompareCount -> Query -> Query -> Sem r ()
- assertAnswerConst :: forall a r. (Show a, Real a, Val a, HookCommon r) => CompareCount -> Query -> a -> Sem r ()
- assertAllValuesWithin :: (HookCommon r, Val a) => Relation -> SExp -> WithinSet a -> Sem r ()
- assertAnyValuesWithin :: (HookCommon r, Val a) => Relation -> SExp -> WithinSet a -> Sem r ()
- assertNoValuesWithin :: (HookCommon r, Val a) => Relation -> SExp -> WithinSet a -> Sem r ()
- assertUniqueByWhere :: HookCommon r => Relation -> PredicateSExp -> [Selected SExp] -> Sem r ()
- assertExpression :: HookCommon r => Relation -> SExp -> Sem r ()
- assertNotNull :: (HookCommon r, Member SqlRender r) => Relation -> [SExp] -> Sem r ()
- assertUniqueByCap :: HookCommon r => CountTolerance -> Relation -> [Selected SExp] -> Sem r ()
- assertAnyPresent :: HookCommon r => SExp -> Relation -> Sem r ()
- assertUniqueBy :: HookCommon r => Relation -> [Selected SExp] -> Sem r ()
- runProcessHook :: Member (Embed IO) r => String -> [String] -> Sem r ()
- assertCardinalities :: HookCommon 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.12-IOJ7B058YIK5gpjD82pDT5" '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 r => CompareCount -> Relation -> Relation -> Sem r () #
Compares counts of two relations, fails if check does not hold.
assertCountConst :: HookCommon r => CompareCount -> Relation -> Integer -> Sem r () #
Compares counts of relation against a constant value, fails if check does not hold.
assertAnswers :: forall a r. (Show a, Real a, Val a, HookCommon r) => CompareCount -> Query -> Query -> Sem r () #
Compares result of a two queries, fails if check does not hold.
assertAnswerConst :: forall a r. (Show a, Real a, Val a, HookCommon r) => CompareCount -> Query -> a -> Sem r () #
Compares result of a query against a constant value, fails if check does not hold.
assertAllValuesWithin :: (HookCommon r, Val a) => Relation -> SExp -> WithinSet a -> Sem r () #
Fail if the table column contains some values beyond the specified (inclusive) range.
assertAnyValuesWithin :: (HookCommon r, Val a) => Relation -> SExp -> WithinSet a -> Sem r () #
Fail if the table column contains no values from the specified (inclusive) range.
assertNoValuesWithin :: (HookCommon r, Val a) => Relation -> SExp -> WithinSet a -> Sem r () #
Fail if the table column contains some values within the specified (inclusive) range.
assertUniqueByWhere :: HookCommon 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 r => Relation -> SExp -> Sem r () #
Assert expression is true
assertNotNull :: (HookCommon r, Member SqlRender r) => Relation -> [SExp] -> Sem r () #
Fail if any of the given expressions/columns have any NULL values
assertUniqueByCap :: HookCommon r => CountTolerance -> Relation -> [Selected SExp] -> Sem r () #
Checks if number of duplicate rows in a table is within certain tolerance.
assertAnyPresent :: HookCommon r => SExp -> Relation -> Sem r () #
Checks if any values are present in given column.
assertUniqueBy :: HookCommon r => Relation -> [Selected SExp] -> Sem r () #
Fail if there are non-unique rows in the result.
assertCardinalities :: HookCommon r => CompareCount -> Relation -> SExp -> Relation -> SExp -> Sem r () #
Checks the cardinalities of two columns that may be sourced from different tables.