napkin-runtime
Safe HaskellNone
LanguageGHC2024

Napkin.Spec.Yaml.Hooks

Synopsis

Documentation

data YamlRangeType #

Instances

Instances details
FromJSON YamlRangeType # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

ToJSON YamlRangeType # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

Bounded YamlRangeType # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

Enum YamlRangeType # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

Generic YamlRangeType # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

Associated Types

type Rep YamlRangeType 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

type Rep YamlRangeType = D1 ('MetaData "YamlRangeType" "Napkin.Spec.Yaml.Hooks" "napkin-runtime-2.0.0-9enTD0RIrF78Wys8ycSC3g" '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))))
Show YamlRangeType # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

Eq YamlRangeType # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

SingKind YamlRangeType # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

Associated Types

type Demote YamlRangeType 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

SingI 'RBool # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

Methods

sing :: Sing 'RBool #

SingI 'RDate # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

Methods

sing :: Sing 'RDate #

SingI 'RDateTime # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

Methods

sing :: Sing 'RDateTime #

SingI 'RDouble # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

Methods

sing :: Sing 'RDouble #

SingI 'RInt # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

Methods

sing :: Sing 'RInt #

SingI 'RString # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

Methods

sing :: Sing 'RString #

type Rep YamlRangeType # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

type Rep YamlRangeType = D1 ('MetaData "YamlRangeType" "Napkin.Spec.Yaml.Hooks" "napkin-runtime-2.0.0-9enTD0RIrF78Wys8ycSC3g" '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))))
type Demote YamlRangeType # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

type Sing # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

type family RBoolSym0 :: YamlRangeType where ... #

Equations

RBoolSym0 = 'RBool 

type family RDateSym0 :: YamlRangeType where ... #

Equations

RDateSym0 = 'RDate 

type family RDateTimeSym0 :: YamlRangeType where ... #

Equations

RDateTimeSym0 = 'RDateTime 

type family RDoubleSym0 :: YamlRangeType where ... #

Equations

RDoubleSym0 = 'RDouble 

type family RIntSym0 :: YamlRangeType where ... #

Equations

RIntSym0 = 'RInt 

type family RStringSym0 :: YamlRangeType where ... #

Equations

RStringSym0 = 'RString 

data YamlRange (t :: YamlRangeType) #

Constructors

YamlRange (WithinSet (ToRangeType t)) 

Instances

Instances details
ToJSON (ToRangeType t) => ToJSON (YamlRange t) # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

Generic (YamlRange t) # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

Associated Types

type Rep (YamlRange t) 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

type Rep (YamlRange t) = D1 ('MetaData "YamlRange" "Napkin.Spec.Yaml.Hooks" "napkin-runtime-2.0.0-9enTD0RIrF78Wys8ycSC3g" 'False) (C1 ('MetaCons "YamlRange" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (WithinSet (ToRangeType t)))))

Methods

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

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

Show (ToRangeType t) => Show (YamlRange t) # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

Eq (ToRangeType t) => Eq (YamlRange t) # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

Methods

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

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

type Rep (YamlRange t) # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

type Rep (YamlRange t) = D1 ('MetaData "YamlRange" "Napkin.Spec.Yaml.Hooks" "napkin-runtime-2.0.0-9enTD0RIrF78Wys8ycSC3g" 'False) (C1 ('MetaCons "YamlRange" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (WithinSet (ToRangeType t)))))

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

external :: HookForYaml b #

Define a hook with external shell script or command with arguments

external:
  shell: ./execute_hook.sh --connection "{{{db_url.raw}}}" --table "{{{table.db}}}"

or > external: > command: ./execute_hook.sh > arguments: > - --connection "{{{db_url.raw}}}" > - --table "{{{table.db}}}"

assert_unique :: 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 :: 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 :: 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 :: 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]

assert_expression :: HookForYaml b #

Assert expression is true

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

assert_not_null :: 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, '')
      alias: zip_code_not_null

assert_cardinalities :: HookForYaml b #

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

assert_cardinalities:
 table: target_table
 column: column_foo
 equal:
   source_table_foo:
     - column_bar
     - column_baz
   source_table_bar:
     - column_bar

assert_multiple_columns_cardinalities :: HookForYaml b #

Checks the cardinalities of multiple columns

assert_multiple_columns_cardinalities:
  table: target_table
  columns:
    - column_foo
    - column_thud
  equal:
    table: source_table_foo:
    columns:
      - column_bar
      - column_baz

newtype YamlHook b #

Instances

Instances details
Show (YamlHook b) # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

Methods

showsPrec :: Int -> YamlHook b -> ShowS #

show :: YamlHook b -> String #

showList :: [YamlHook b] -> ShowS #

Eq (YamlHook b) # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

Methods

(==) :: YamlHook b -> YamlHook b -> Bool #

(/=) :: YamlHook b -> YamlHook b -> Bool #

data YamlHookOnFailure #

Constructors

FFail 
FWarnOnly 

Instances

Instances details
FromJSON YamlHookOnFailure # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

ToJSON YamlHookOnFailure # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

Generic YamlHookOnFailure # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

Associated Types

type Rep YamlHookOnFailure 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

type Rep YamlHookOnFailure = D1 ('MetaData "YamlHookOnFailure" "Napkin.Spec.Yaml.Hooks" "napkin-runtime-2.0.0-9enTD0RIrF78Wys8ycSC3g" 'False) (C1 ('MetaCons "FFail" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FWarnOnly" 'PrefixI 'False) (U1 :: Type -> Type))
Show YamlHookOnFailure # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

Eq YamlHookOnFailure # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

type Rep YamlHookOnFailure # 
Instance details

Defined in Napkin.Spec.Yaml.Hooks

type Rep YamlHookOnFailure = D1 ('MetaData "YamlHookOnFailure" "Napkin.Spec.Yaml.Hooks" "napkin-runtime-2.0.0-9enTD0RIrF78Wys8ycSC3g" 'False) (C1 ('MetaCons "FFail" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FWarnOnly" 'PrefixI 'False) (U1 :: Type -> Type))