Documentation
¶
Overview ¶
Package output renders query results. Writers are streaming: rows are written as they arrive and nothing is held back beyond what a format needs to lay itself out.
Index ¶
Constants ¶
View Source
const ( Table = "table" Vertical = "vertical" TSV = "tsv" TSVWithNames = "tsvwithnames" CSV = "csv" CSVWithNames = "csvwithnames" JSON = "json" JSONLines = "jsonlines" Null = "null" )
Output format names.
Variables ¶
View Source
var Formats = []string{Table, Vertical, TSV, TSVWithNames, CSV, CSVWithNames, JSON, JSONLines, Null}
Formats lists the supported formats in display order.
Functions ¶
Types ¶
type TotalsWriter ¶
TotalsWriter is implemented by writers that can show the extra row of a WITH TOTALS query. Totals is called at most once, after the last Row and before End.
type Writer ¶
type Writer interface {
// Begin is called once, before the first row.
Begin(cols []Column) error
// Row writes one row. The values slice may be reused by the caller.
Row(values []any) error
// End finishes the result set and flushes buffered output.
End() error
}
Writer renders one result set.
Click to show internal directories.
Click to hide internal directories.