napkin-runtime-2.0.0
Safe HaskellNone
LanguageGHC2024

Napkin.Spec.Yaml.Types.Tables

Synopsis

Documentation

data CSVTableStrategy #

csv importing options

Instances

Instances details
FromJSON CSVTableStrategy # 
Instance details

Defined in Napkin.Spec.Yaml.Types.Tables

ToJSON CSVTableStrategy # 
Instance details

Defined in Napkin.Spec.Yaml.Types.Tables

Bounded CSVTableStrategy # 
Instance details

Defined in Napkin.Spec.Yaml.Types.Tables

Enum CSVTableStrategy # 
Instance details

Defined in Napkin.Spec.Yaml.Types.Tables

Generic CSVTableStrategy # 
Instance details

Defined in Napkin.Spec.Yaml.Types.Tables

Associated Types

type Rep CSVTableStrategy 
Instance details

Defined in Napkin.Spec.Yaml.Types.Tables

type Rep CSVTableStrategy = D1 ('MetaData "CSVTableStrategy" "Napkin.Spec.Yaml.Types.Tables" "napkin-runtime-2.0.0-Ct8w2lsjRa3AUoSevHfCKx" 'False) (C1 ('MetaCons "CSVTableStrategy_Recreate" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "CSVTableStrategy_Truncate" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CSVTableStrategy_Append" 'PrefixI 'False) (U1 :: Type -> Type)))
Eq CSVTableStrategy # 
Instance details

Defined in Napkin.Spec.Yaml.Types.Tables

type Rep CSVTableStrategy # 
Instance details

Defined in Napkin.Spec.Yaml.Types.Tables

type Rep CSVTableStrategy = D1 ('MetaData "CSVTableStrategy" "Napkin.Spec.Yaml.Types.Tables" "napkin-runtime-2.0.0-Ct8w2lsjRa3AUoSevHfCKx" 'False) (C1 ('MetaCons "CSVTableStrategy_Recreate" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "CSVTableStrategy_Truncate" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CSVTableStrategy_Append" 'PrefixI 'False) (U1 :: Type -> Type)))

newtype YamlRange a #

Constructors

YamlRange 

Fields

Instances

Instances details
Generic (YamlRange a) # 
Instance details

Defined in Napkin.Spec.Yaml.Types.Tables

Associated Types

type Rep (YamlRange a) 
Instance details

Defined in Napkin.Spec.Yaml.Types.Tables

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

Methods

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

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

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

Defined in Napkin.Spec.Yaml.Types.Tables

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

Defined in Napkin.Spec.Yaml.Types.Tables

Methods

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

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

type Rep (YamlRange a) # 
Instance details

Defined in Napkin.Spec.Yaml.Types.Tables

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

external :: SpecProgramForYaml b #

Define table with external shell script or command with arguments

external:
  shell: ./import_table.sh --from "{{{db_url.raw}}}" --table "{{{table.db}}}"

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

sql_query :: BackendMetaConstraints b => SpecProgramForYaml b #

Define table with SQL query specified directly in YAML

sql_query:
  query: SELECT * FROM foo

sql_file :: BackendMetaConstraints b => SpecProgramForYaml b #

Define table with SQL query specified directly in YAML. vars is an optional object used to specify variables used in mustache interpolation.

sql_file:
  source: some_file.sql
  vars:
    agg: sum

sql_file_with_schema :: Default (BackendTableMeta b) => SpecProgramForYaml b #

Define table with Explicit DDL to create schema and (optionally) SQL Insert Statements to add data, with ExtendedStatement specified directly in YAML. vars is an optional object used to specify variables used in mustache interpolation. The table will always be recreated if update strategy calls for it, and any existing data on table will be lost.

sql_file_with_schema:
  source: some_file_extended.sql
  vars:
    agg: sum

sql_file_insert :: Default (BackendTableMeta b) => SpecProgramForYaml b #

Insert into a table (or create if non-existent) with SQL query specified directly in YAML. The data is appended to the table, and the table is never truncated. vars is an optional object used to specify variables used in mustache interpolation.

sql_file_insert:
  source: some_file.sql
  vars:
    agg: sum

sql_file_with_schema_insert :: Default (BackendTableMeta b) => SpecProgramForYaml b #

Insert into a table (or create if non-existent) with explicit DDL to create schema and SQL Insert Statements to add data, with ExtendedStatement specified directly in YAML. The data is appended to the table, and the table is never truncated. vars is an optional object used to specify variables used in mustache interpolation.

sql_file_with_schema_insert:
  source: some_file.sql
  vars:
    agg: sum

csv_file :: (BackendMetaConstraints b, Default (BackendTableMeta b)) => SpecProgramForYaml b #

Create a table from yaml schema specification and load content from a given CSV file. source CSV file path type can be int, double, text, day, datetime header CSV header is present in source file columns ordered (as in CSV source file columns) list of column name-type association create create table by default is true chunks optional chunks size in which source file is loaded csv_separator optional character providing the csv separator character (',' by default) csv_quote_char optional character providing quotes character ('"' by default)

csv_file:
  source: input.csv
  chunks: 50
  header: true
  create: false
  csv_separator: ','
  csv_quote_char: '"'
  columns:
    - field1: type1
    ..
    - fieldn: typen

copy :: BackendMetaConstraints b => SpecProgramForYaml b #

Copy a table

copy:
  table: table_to_be_copied
  if_exists: append