Documentation
¶
Index ¶
- func DescribeTableResult(result pgxspecial.SpecialCommandResult, c *config.Config) (string, error)
- func Error(err error, w io.Writer) error
- func ExtensionVerboseResult(result pgxspecial.SpecialCommandResult, c *config.Config) (string, error)
- func FormatVal(val driver.Value, showPrintableUnicode bool, showNewLinesAndTabs bool) string
- func GetColumnStrings(rows database.Rows, showMoreChars bool) []string
- func GetTableStyle(s *config.Config) renderer.ColorizedConfig
- func Render(w, Ew io.Writer, formatter Formatter, cols []string, row RowStrIter) error
- func RowsResult(result pgxspecial.SpecialCommandResult, c *config.Config) (string, error)
- func Table(data Data, w io.Writer, c *config.Config) error
- func TableRender(cols []string, rowrowIter RowStrIter, caption string, w, Ew io.Writer, ...) error
- type ColorField
- type Data
- type Formatter
- type RowIter
- type RowStrIter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DescribeTableResult ¶
func DescribeTableResult(result pgxspecial.SpecialCommandResult, c *config.Config) (string, error)
DescribeTableResult renders each describe-table section.
func ExtensionVerboseResult ¶
func ExtensionVerboseResult(result pgxspecial.SpecialCommandResult, c *config.Config) (string, error)
ExtensionVerboseResult renders each verbose extension result.
func FormatVal ¶ added in v0.2.1
FormatVal formats a value retrieved by a SQL driver into a string suitable for displaying to the user.
func GetColumnStrings ¶ added in v0.2.1
func GetTableStyle ¶
func GetTableStyle(s *config.Config) renderer.ColorizedConfig
func RowsResult ¶
func RowsResult(result pgxspecial.SpecialCommandResult, c *config.Config) (string, error)
RowsResult renders row-based special command output.
func Table ¶
Table renders the provided data as a table. Currently been used by the special results / meta commands only.
func TableRender ¶ added in v0.2.1
Types ¶
type ColorField ¶
type ColorField string
const ( ColorHeader ColorField = "header" ColorColumn ColorField = "column" ColorCaption ColorField = "caption" )
type RowStrIter ¶ added in v0.2.1
type RowStrIter interface {
Next() (row []string, err error)
ToSlice() (allRows [][]string, err error)
}
RowStrIter is an iterator interface for the PrintQueryOutput function. It is used so that results can be streamed to the row formatters as they arrive to the CLI.
func NewRowSliceIter ¶ added in v0.2.1
func NewRowSliceIter(allRows [][]string) RowStrIter
NewRowSliceIter is an implementation of the rowStrIter interface and it is used when the rows have not been buffered into memory yet and we want to stream them to the row formatters as they arrive over the network.