Documentation
¶
Overview ¶
Package csv implements the sq driver for CSV/TSV et al.
Index ¶
Constants ¶
View Source
const ( // TypeCSV is the CSV driver type. TypeCSV = source.DriverType("csv") // TypeTSV is the TSV driver type. TypeTSV = source.DriverType("tsv") )
Variables ¶
View Source
var OptDelim = options.NewString( "driver.csv.delim", "", 0, delimCommaKey, nil, "Delimiter for ingest CSV data", `Delimiter to use for CSV files. Default is "comma". Possible values are: comma, space, pipe, tab, colon, semi, period.`, options.TagSource, "csv", )
OptDelim specifies the CSV delimiter to use.
View Source
var OptEmptyAsNull = options.NewBool( "driver.csv.empty-as-null", "", 0, true, "Treat ingest empty CSV fields as NULL", `When true, empty CSV fields are treated as NULL. When false, the zero value for that type is used, e.g. empty string or 0.`, options.TagSource, "csv", )
OptEmptyAsNull determines if an empty CSV field is treated as NULL or as the zero value for the kind of that field.
Functions ¶
func DetectCSV ¶
func DetectCSV(ctx context.Context, openFn source.FileOpenFunc) (detected source.DriverType, score float32, err error, )
DetectCSV implements source.DriverDetectFunc.
func DetectTSV ¶
func DetectTSV(ctx context.Context, openFn source.FileOpenFunc) (detected source.DriverType, score float32, err error, )
DetectTSV implements source.DriverDetectFunc.
func NamedDelims ¶ added in v0.34.0
func NamedDelims() []string
NamedDelims returns the named delimiters, such as [comma, tab, pipe...].
Types ¶
Click to show internal directories.
Click to hide internal directories.