napkin-0.5.12
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.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])))

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.

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

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

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