napkin-0.5.14
Safe HaskellSafe-Inferred
LanguageGHC2021

Napkin.Run.Effects.CSV.CSVImport

Synopsis

Documentation

data CSVHeader #

Constructors

CSVHeader 
CSVNoHeader 

Instances

Instances details
Show CSVHeader # 
Instance details

Defined in Napkin.Run.Effects.CSV.CSVImport

Eq CSVHeader # 
Instance details

Defined in Napkin.Run.Effects.CSV.CSVImport

newtype Chunks #

Constructors

Chunks 

Fields

Instances

Instances details
Show Chunks # 
Instance details

Defined in Napkin.Run.Effects.CSV.CSVImport

Eq Chunks # 
Instance details

Defined in Napkin.Run.Effects.CSV.CSVImport

Methods

(==) :: Chunks -> Chunks -> Bool #

(/=) :: Chunks -> Chunks -> Bool #

data CSVType #

Instances

Instances details
FromJSON CSVType # 
Instance details

Defined in Napkin.Run.Effects.CSV.CSVImport

ToJSON CSVType # 
Instance details

Defined in Napkin.Run.Effects.CSV.CSVImport

Bounded CSVType # 
Instance details

Defined in Napkin.Run.Effects.CSV.CSVImport

Enum CSVType # 
Instance details

Defined in Napkin.Run.Effects.CSV.CSVImport

Generic CSVType # 
Instance details

Defined in Napkin.Run.Effects.CSV.CSVImport

Associated Types

type Rep CSVType :: Type -> Type #

Methods

from :: CSVType -> Rep CSVType x #

to :: Rep CSVType x -> CSVType #

Show CSVType # 
Instance details

Defined in Napkin.Run.Effects.CSV.CSVImport

Eq CSVType # 
Instance details

Defined in Napkin.Run.Effects.CSV.CSVImport

Methods

(==) :: CSVType -> CSVType -> Bool #

(/=) :: CSVType -> CSVType -> Bool #

type Rep CSVType # 
Instance details

Defined in Napkin.Run.Effects.CSV.CSVImport

type Rep CSVType = D1 ('MetaData "CSVType" "Napkin.Run.Effects.CSV.CSVImport" "napkin-0.5.14-JrXUGmKUOt9J0meJSj0Kh4" 'False) ((C1 ('MetaCons "CSVTyInteger" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CSVTyDouble" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "CSVTyDate" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "CSVTyDateTime" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CSVTyText" 'PrefixI 'False) (U1 :: Type -> Type))))

newtype ColumnName #

Constructors

ColumnName 

Fields

Instances

Instances details
IsString ColumnName # 
Instance details

Defined in Napkin.Run.Effects.CSV.CSVImport

Show ColumnName # 
Instance details

Defined in Napkin.Run.Effects.CSV.CSVImport

Eq ColumnName # 
Instance details

Defined in Napkin.Run.Effects.CSV.CSVImport

newtype CSVError #

Constructors

CSVError Text 

class CSVImport bk where #

Methods

chunkLimit :: Int #

backend limit on inserts union size

isEnabled :: Bool #

to exclude backends, for example: BigQuery for which this mechanism is not compatible and bigquery-tools should be used

Instances

Instances details
CSVImport BigQuery # 
Instance details

Defined in Napkin.Run.BigQuery

CSVImport MsSql # 
Instance details

Defined in Napkin.Run.MsSql

CSVImport Postgres # 
Instance details

Defined in Napkin.Run.Postgres

CSVImport Redshift # 
Instance details

Defined in Napkin.Run.Redshift

CSVImport Sqlite # 
Instance details

Defined in Napkin.Run.Sqlite

createTableQuery :: CsvSchema -> Query #

Generates an empty select query with the specified columns in Schema argument for table creation

loadCSV :: forall bk m. CSVContext m bk => CSVSettings -> BackendConn bk -> Ref Table -> SpecPaths -> FilePath -> CSVHeader -> Chunks -> CsvSchema -> m () #

loadDb :: forall bk m. CSVContext m bk => BackendConn bk -> Ref Table -> CSVHeader -> Chunks -> CsvSchema -> ConduitT [Text] Void (ResourceT m) () #

parseResult :: [(b, String)] -> Either Text b #