| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Napkin.Run.Effects.Hooks
Synopsis
- module Napkin.Run.Effects.Hooks.Types
- type BoundToRelation a = Ref Relation -> a
- assertAllValuesWithin :: forall {k} (b :: k) (r :: EffectRow) a rel. (AsRelation rel, GlobalAssert b r, Val a) => rel -> 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) rel. (AsRelation rel, GlobalAssert b r) => BoundToRelation SExp -> rel -> Sem r ()
- assertAnyPresentT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => BoundToRelation SExp -> Sem r ()
- assertAnyValuesWithin :: forall {k} (b :: k) (r :: EffectRow) a rel. (AsRelation rel, GlobalAssert b r, Val a) => rel -> 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) rel1 rel2. (AsRelation rel1, AsRelation rel2, GlobalAssert b r) => CompareCount -> rel1 -> BoundToRelation (Selected SExp) -> rel2 -> BoundToRelation (Selected SExp) -> Sem r ()
- assertCardinalitiesT :: forall {k} (b :: k) (r :: EffectRow) rel. (AsRelation rel, Assert b r) => CompareCount -> BoundToRelation (Selected SExp) -> rel -> BoundToRelation (Selected SExp) -> Sem r ()
- assertCount :: forall {k} (b :: k) (r :: EffectRow) rel1 rel2. (AsRelation rel1, AsRelation rel2, GlobalAssert b r) => CompareCount -> rel1 -> rel2 -> Sem r ()
- assertCountConst :: forall {k} (b :: k) (r :: EffectRow) rel. (AsRelation rel, GlobalAssert b r) => CompareCount -> Integer -> rel -> Sem r ()
- assertCountConstT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => CompareCount -> Integer -> Sem r ()
- assertCountT :: forall {k} (b :: k) (r :: EffectRow) rel. (AsRelation rel, Assert b r) => CompareCount -> rel -> Sem r ()
- assertExpression :: forall {k} (b :: k) (r :: EffectRow) rel. (AsRelation rel, GlobalAssert b r) => rel -> 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) rel. (AsRelation rel, GlobalAssert b r) => rel -> 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 rel. (AsRelation rel, GlobalAssert b r, Val a) => rel -> 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) rel. (AsRelation rel, GlobalAssert b r) => rel -> BoundToRelation (NonEmpty (Selected SExp)) -> Sem r ()
- assertUniqueByCap :: forall {k} (b :: k) (r :: EffectRow) rel. (AsRelation rel, GlobalAssert b r) => CountTolerance -> rel -> 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) rel. (AsRelation rel, GlobalAssert b r) => rel -> BoundToRelation SExp -> BoundToRelation (NonEmpty (Selected SExp)) -> Sem r ()
- assertUniqueByWhereT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => BoundToRelation SExp -> BoundToRelation (NonEmpty (Selected SExp)) -> Sem r ()
- assertMultipleCardinalities :: forall {k} (b :: k) (r :: EffectRow) rel. (AsRelation rel, GlobalAssert b r) => CompareCount -> rel -> 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) rel1 rel2. (AsRelation rel1, AsRelation rel2, GlobalAssert b r) => CompareCount -> rel1 -> BoundToRelation [Selected SExp] -> rel2 -> BoundToRelation [Selected SExp] -> Sem r ()
- assertZeroCasesOf :: forall {k} (b :: k) (r :: EffectRow) rel. (AsRelation rel, Assert b r) => rel -> BoundToRelation (Selected SExp) -> Sem r ()
- assertZeroCasesOfT :: forall {k} (b :: k) (r :: EffectRow). Assert b r => BoundToRelation (Selected SExp) -> Sem r ()
Documentation
type BoundToRelation a = Ref Relation -> a #
assertAllValuesWithin :: forall {k} (b :: k) (r :: EffectRow) a rel. (AsRelation rel, GlobalAssert b r, Val a) => rel -> 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) rel. (AsRelation rel, GlobalAssert b r) => BoundToRelation SExp -> rel -> 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 rel. (AsRelation rel, GlobalAssert b r, Val a) => rel -> 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) rel1 rel2. (AsRelation rel1, AsRelation rel2, GlobalAssert b r) => CompareCount -> rel1 -> BoundToRelation (Selected SExp) -> rel2 -> 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) rel. (AsRelation rel, Assert b r) => CompareCount -> BoundToRelation (Selected SExp) -> rel -> 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) rel1 rel2. (AsRelation rel1, AsRelation rel2, GlobalAssert b r) => CompareCount -> rel1 -> rel2 -> Sem r () #
Compares counts of two relations, fails if check does not hold.
assertCountConst :: forall {k} (b :: k) (r :: EffectRow) rel. (AsRelation rel, GlobalAssert b r) => CompareCount -> Integer -> rel -> 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) rel. (AsRelation rel, Assert b r) => CompareCount -> rel -> Sem r () #
Compares counts of target and a relation, fails if check does not hold.
assertExpression :: forall {k} (b :: k) (r :: EffectRow) rel. (AsRelation rel, GlobalAssert b r) => rel -> 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) rel. (AsRelation rel, GlobalAssert b r) => rel -> 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 rel. (AsRelation rel, GlobalAssert b r, Val a) => rel -> 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) rel. (AsRelation rel, GlobalAssert b r) => rel -> BoundToRelation (NonEmpty (Selected SExp)) -> Sem r () #
Fail if there are non-unique rows in the result.
assertUniqueByCap :: forall {k} (b :: k) (r :: EffectRow) rel. (AsRelation rel, GlobalAssert b r) => CountTolerance -> rel -> 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) rel. (AsRelation rel, GlobalAssert b r) => rel -> BoundToRelation SExp -> 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 SExp -> 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) rel. (AsRelation rel, GlobalAssert b r) => CompareCount -> rel -> 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) rel1 rel2. (AsRelation rel1, AsRelation rel2, GlobalAssert b r) => CompareCount -> rel1 -> BoundToRelation [Selected SExp] -> rel2 -> 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) rel. (AsRelation rel, Assert b r) => rel -> 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.