napkin-0.5.10
Safe HaskellNone
LanguageHaskell2010

Napkin.Spec.Yaml.Types.Hooks

Synopsis

Documentation

type HookName = Text #

newtype YamlRange a #

Constructors

YamlRange 

Fields

Instances

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

Defined in Napkin.Spec.Yaml.Types.Hooks

Methods

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

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

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

Defined in Napkin.Spec.Yaml.Types.Hooks

Generic (YamlRange a) # 
Instance details

Defined in Napkin.Spec.Yaml.Types.Hooks

Associated Types

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

Methods

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

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

(ToJSON a, Val a) => ToJSON (YamlRange a) # 
Instance details

Defined in Napkin.Spec.Yaml.Types.Hooks

(FromJSON a, Val a) => FromJSON (YamlRange a) # 
Instance details

Defined in Napkin.Spec.Yaml.Types.Hooks

type Rep (YamlRange a) # 
Instance details

Defined in Napkin.Spec.Yaml.Types.Hooks

type Rep (YamlRange a) = D1 ('MetaData "YamlRange" "Napkin.Spec.Yaml.Types.Hooks" "napkin-0.5.10-C0Hygrce3goLKcQ6g1wIUX" 'True) (C1 ('MetaCons "YamlRange" 'PrefixI 'True) (S1 ('MetaSel ('Just "toRange") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (WithinSet a))))

data YamlRangeType #

Instances

Instances details
Bounded YamlRangeType # 
Instance details

Defined in Napkin.Spec.Yaml.Types.Hooks

Enum YamlRangeType # 
Instance details

Defined in Napkin.Spec.Yaml.Types.Hooks

Eq YamlRangeType # 
Instance details

Defined in Napkin.Spec.Yaml.Types.Hooks

Show YamlRangeType # 
Instance details

Defined in Napkin.Spec.Yaml.Types.Hooks

Generic YamlRangeType # 
Instance details

Defined in Napkin.Spec.Yaml.Types.Hooks

Associated Types

type Rep YamlRangeType :: Type -> Type #

ToJSON YamlRangeType # 
Instance details

Defined in Napkin.Spec.Yaml.Types.Hooks

FromJSON YamlRangeType # 
Instance details

Defined in Napkin.Spec.Yaml.Types.Hooks

type Rep YamlRangeType # 
Instance details

Defined in Napkin.Spec.Yaml.Types.Hooks

type Rep YamlRangeType = D1 ('MetaData "YamlRangeType" "Napkin.Spec.Yaml.Types.Hooks" "napkin-0.5.10-C0Hygrce3goLKcQ6g1wIUX" 'False) ((C1 ('MetaCons "RBool" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "RString" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "RDate" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "RDateTime" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "RDouble" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "RInt" 'PrefixI 'False) (U1 :: Type -> Type))))

(-->) :: a -> b -> (a, b) #

assert_count :: HookForYaml b #

Assert the relationship between table and another table or constant value

Supported checks: equal, greater_than, greater_than_or_equal, less_than, less_than_or_equal, approximately_equal (relative, absolute – see example below).

assert_count:
 table: target_table
 equal: source_table
assert_count:
 table: target_table
 greater_than_or_equal: 871

Approximate equality:

assert_count:
 table: target_table
 approximately_equal: source_table
 type: relative
 tolerance: 0.01

assert_unique :: forall b. (ReifiesBackend b, ParseSQL b) => HookForYaml b #

Assert that table has all rows unique in terms of selected columns.

assert_unique:
  table: target_table
  columns: [Artist, Title]

assert_all_values_within :: forall b. (ReifiesBackend b, ParseSQL b) => HookForYaml b #

Assert that table have only values within specified set in a certain column

assert_all_values_within:
  table: target_table
  column: target_column
  type: date
  from: 2009-01-01
  to: 2013-12-31

or

assert_all_values_within:
  table: target_table
  column: target_column
  values: [StringOne, StringTwo]

assert_any_values_within :: forall b. (ReifiesBackend b, ParseSQL b) => HookForYaml b #

Assert that table have any values within specified set in a certain column

assert_any_values_within:
  table: target_table
  column: target_column
  type: date
  from: 2009-01-01
  to: 2013-12-31

or > assert_any_values_within: > table: target_table > column: target_column > values: [StringOne, StringTwo]

assert_no_values_within :: forall b. (ReifiesBackend b, ParseSQL b) => HookForYaml b #

Assert that table have no values within specified set in a certain column

assert_no_values_within:
  table: target_table
  column: target_column
  type: date
  from: 2009-01-01
  to: 2013-12-31

or > assert_no_values_within: > table: target_table > column: target_column > values: [StringOne, StringTwo]

assertValues :: Object -> (forall a. Val a => WithinSet a -> HookProgram b) -> Parser (HookProgram b) #

assert_expression :: forall b. (ReifiesBackend b, ParseSQL b) => HookForYaml b #

Assert expression is true

assert_expression:
  table: target_table
  expression: AVG(total) = 42

assert_not_null :: forall b. (ReifiesBackend b, ParseSQL b) => HookForYaml b #

Fail if any of the given expressions/columns have any NULL values.

assert_not_null:
  table: target_table
  columns:
    - zip_code
    - expression: NULLIF(zip_code, '')

assert_cardinalities :: forall b. (ReifiesBackend b, ParseSQL b) => HookForYaml b #

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

assert_cardinalities:
 table: target_table
 column: column_foo
 equal:
   table: source_table
   column: column_bar