| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Napkin.Spec.Yaml.Hooks
Synopsis
- type HookForYaml b = SpecProgramReferenceForYaml (HookProgram b)
- data YamlRangeType
- type family RBoolSym0 :: YamlRangeType where ...
- type family RDateSym0 :: YamlRangeType where ...
- type family RDateTimeSym0 :: YamlRangeType where ...
- type family RDoubleSym0 :: YamlRangeType where ...
- type family RIntSym0 :: YamlRangeType where ...
- type family RStringSym0 :: YamlRangeType where ...
- data SYamlRangeType (a :: YamlRangeType) where
- type family ToRangeType (t :: YamlRangeType) where ...
- data YamlRange (t :: YamlRangeType) = YamlRange (WithinSet (ToRangeType t))
- parseYamlRange :: forall (t :: YamlRangeType). (FromJSON (ToRangeType t), Typeable t) => Object -> WarningParser (YamlRange t)
- data ColumnOrExpression
- parseExplicitlyAliasedExpression :: Object -> WarningParser ColumnOrExpression
- parseColumnsOrExpressions :: forall (r :: EffectRow). Members '[SqlParse :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type] r => ColumnOrExpression -> Sem r (Selected SExp)
- assert_count :: HookForYaml b
- external :: HookForYaml b
- assert_unique :: HookForYaml b
- assert_all_values_within :: HookForYaml b
- assert_any_values_within :: HookForYaml b
- assert_no_values_within :: HookForYaml b
- assertValues :: Object -> (forall (t :: YamlRangeType). Val (ToRangeType t) => YamlRange t -> HookProgram b) -> WarningParser (HookProgram b)
- assert_expression :: HookForYaml b
- assert_not_null :: HookForYaml b
- assert_cardinalities :: HookForYaml b
- assert_multiple_columns_cardinalities :: HookForYaml b
- newtype YamlHook b = YamlHook {}
- parseYamlHook :: Maybe SpecTableName -> Value -> WarningParser (YamlHook b)
- data YamlHookOnFailure
Documentation
type HookForYaml b = SpecProgramReferenceForYaml (HookProgram b) #
data YamlRangeType #
Instances
type family RBoolSym0 :: YamlRangeType where ... #
type family RDateSym0 :: YamlRangeType where ... #
type family RDateTimeSym0 :: YamlRangeType where ... #
Equations
| RDateTimeSym0 = 'RDateTime |
type family RDoubleSym0 :: YamlRangeType where ... #
Equations
| RDoubleSym0 = 'RDouble |
type family RIntSym0 :: YamlRangeType where ... #
type family RStringSym0 :: YamlRangeType where ... #
Equations
| RStringSym0 = 'RString |
data SYamlRangeType (a :: YamlRangeType) where #
Constructors
| SRBool :: SYamlRangeType 'RBool | |
| SRString :: SYamlRangeType 'RString | |
| SRDate :: SYamlRangeType 'RDate | |
| SRDateTime :: SYamlRangeType 'RDateTime | |
| SRDouble :: SYamlRangeType 'RDouble | |
| SRInt :: SYamlRangeType 'RInt |
type family ToRangeType (t :: YamlRangeType) where ... #
Equations
| ToRangeType 'RBool = Bool | |
| ToRangeType 'RString = Text | |
| ToRangeType 'RDate = Day | |
| ToRangeType 'RDateTime = UTCTime | |
| ToRangeType 'RDouble = Double | |
| ToRangeType 'RInt = Int |
data YamlRange (t :: YamlRangeType) #
Constructors
| YamlRange (WithinSet (ToRangeType t)) |
Instances
| ToJSON (ToRangeType t) => ToJSON (YamlRange t) # | |||||
| Generic (YamlRange t) # | |||||
Defined in Napkin.Spec.Yaml.Hooks Associated Types
| |||||
| Show (ToRangeType t) => Show (YamlRange t) # | |||||
| Eq (ToRangeType t) => Eq (YamlRange t) # | |||||
| type Rep (YamlRange t) # | |||||
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))))) | |||||
parseYamlRange :: forall (t :: YamlRangeType). (FromJSON (ToRangeType t), Typeable t) => Object -> WarningParser (YamlRange t) #
data ColumnOrExpression #
Constructors
| ImplicitlyNamedColumn Text | |
| ExplicitlyAliasedExpression | |
Fields
| |
Instances
| FromJSON ColumnOrExpression # | |
Defined in Napkin.Spec.Yaml.Hooks Methods parseJSON :: Value -> Parser ColumnOrExpression # parseJSONList :: Value -> Parser [ColumnOrExpression] # | |
parseColumnsOrExpressions :: forall (r :: EffectRow). Members '[SqlParse :: (Type -> Type) -> Type -> Type, FatalError :: (Type -> Type) -> Type -> Type] r => ColumnOrExpression -> Sem r (Selected SExp) #
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]
assertValues :: Object -> (forall (t :: YamlRangeType). Val (ToRangeType t) => YamlRange t -> HookProgram b) -> WarningParser (HookProgram b) #
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_nullassert_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_barassert_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_bazparseYamlHook :: Maybe SpecTableName -> Value -> WarningParser (YamlHook b) #
data YamlHookOnFailure #
Instances
| FromJSON YamlHookOnFailure # | |||||
Defined in Napkin.Spec.Yaml.Hooks Methods parseJSON :: Value -> Parser YamlHookOnFailure # parseJSONList :: Value -> Parser [YamlHookOnFailure] # | |||||
| ToJSON YamlHookOnFailure # | |||||
Defined in Napkin.Spec.Yaml.Hooks Methods toJSON :: YamlHookOnFailure -> Value # toEncoding :: YamlHookOnFailure -> Encoding # toJSONList :: [YamlHookOnFailure] -> Value # toEncodingList :: [YamlHookOnFailure] -> Encoding # omitField :: YamlHookOnFailure -> Bool # | |||||
| Generic YamlHookOnFailure # | |||||
Defined in Napkin.Spec.Yaml.Hooks Associated Types
Methods from :: YamlHookOnFailure -> Rep YamlHookOnFailure x # to :: Rep YamlHookOnFailure x -> YamlHookOnFailure # | |||||
| Show YamlHookOnFailure # | |||||
Defined in Napkin.Spec.Yaml.Hooks Methods showsPrec :: Int -> YamlHookOnFailure -> ShowS # show :: YamlHookOnFailure -> String # showList :: [YamlHookOnFailure] -> ShowS # | |||||
| Eq YamlHookOnFailure # | |||||
Defined in Napkin.Spec.Yaml.Hooks Methods (==) :: YamlHookOnFailure -> YamlHookOnFailure -> Bool # (/=) :: YamlHookOnFailure -> YamlHookOnFailure -> Bool # | |||||
| type Rep YamlHookOnFailure # | |||||
Defined in Napkin.Spec.Yaml.Hooks | |||||