MCPcopy Create free account
hub / github.com/araddon/qlbridge / CsvDataSource

Struct CsvDataSource

datasource/csv.go:32–44  ·  view source on GitHub ↗

Csv DataSource, implements qlbridge schema DataSource, SourceConn, Scanner to allow csv files to be full featured databases. - very, very naive scanner, forward only single pass - can open a file with .Open() - assumes comma delimited - not thread-safe - does not implement write operations

Source from the content-addressed store, hash-verified

30// - not thread-safe
31// - does not implement write operations
32type CsvDataSource struct {
33 table string
34 tbl *schema.Table
35 exit <-chan bool
36 csvr *csv.Reader
37 gz *gzip.Reader
38 rc io.ReadCloser
39 rowct uint64
40 headers []string
41 colindex map[string]int
42 indexCol int
43 filter expr.Node
44}
45
46// NewCsvSource reader assumes we are getting first row as headers
47// - optionally may be gzipped

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected