napkin-0.5.13
Safe HaskellNone
LanguageHaskell2010

Napkin.Run.Effects.Hooks

Synopsis

Documentation

data WithinSet a #

Constructors

FromToRange a a 
ValuesList [a] 

Instances

Instances details
Eq a => Eq (WithinSet a) # 
Instance details

Defined in Napkin.Run.Effects.Hooks.Types

Methods

(==) :: WithinSet a -> WithinSet a -> Bool #

(/=) :: WithinSet a -> WithinSet a -> Bool #

Show a => Show (WithinSet a) # 
Instance details

Defined in Napkin.Run.Effects.Hooks.Types

Generic (WithinSet a) # 
Instance details

Defined in Napkin.Run.Effects.Hooks.Types

Associated Types

type Rep (WithinSet a) :: Type -> Type #

Methods

from :: WithinSet a -> Rep (WithinSet a) x #

to :: Rep (WithinSet a) x -> WithinSet a #

type Rep (WithinSet a) # 
Instance details

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])))

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.

runProcessHook :: Member (Embed IO) r => String -> [String] -> Sem r () #

assertCardinalities :: HookCommon b r => CompareCount -> Relation -> SExp -> Relation -> SExp -> Sem r () #

Checks the cardinalities of two columns that may be sourced from different tables.