format

package
v0.18.49 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package format provides output formatting for query results.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(w io.Writer, f Format, columns []string, rows []map[string]any) error

Write formats columns and rows to the writer in the given format, with no column type information. Values render as the engine boxes them, so a TIMESTAMP column prints as its raw epoch integer; prefer WriteTyped wherever the result's column metadata is on hand.

func WriteTyped

func WriteTyped(w io.Writer, f Format, columns []string, types []parquet.TypeID, rows []map[string]any) error

WriteTyped is Write with the declared type of each column, positionally aligned with columns (a short or nil slice just means "unknown" for the remainder).

The engine boxes a TIMESTAMP as epoch milliseconds because every compute path that shares that boxing reads it as a number; only a renderer holding the column's declared type can turn it back into an instant, so the type has to reach this far (#321).

Types

type Format

type Format int

Format identifies an output format.

const (
	Table Format = iota
	JSON
	CSV
)

func ParseFormat

func ParseFormat(s string) (Format, error)

ParseFormat parses a format name string.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL