Documentation
¶
Overview ¶
CSV rendering (RFC 4180 via encoding/csv).
JSON Lines rendering: one object per row, keys in column order.
Package sink renders decoded rows as CSV or JSON Lines.
Sinks are lazy about columns: when a dump carries no column names (a bare `INSERT INTO t VALUES …` with no CREATE TABLE in the file), names c1…cN are synthesized from the width of the first row.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// Columns are the output column names; nil synthesizes c1…cN.
Columns []string
// NullRepr is the CSV spelling of SQL NULL (default: empty string).
NullRepr string
// NoHeader suppresses the CSV header row.
NoHeader bool
}
Options configure rendering shared by all formats.
type Sink ¶
type Sink interface {
// Row writes one row. Implementations must tolerate rows wider or
// narrower than the column list.
Row(vals []parse.Value) error
// Close flushes buffered output. It does not close the underlying
// writer.
Close() error
}
Sink consumes decoded rows for one table.
Click to show internal directories.
Click to hide internal directories.