Documentation ¶
Index ¶
- func ColumnValueAsString(val interface{}, col *queryresult.ColumnDef, opts ...ColumnValueOption) (result string, err error)
- func ColumnValuesAsString(values []interface{}, columns []*queryresult.ColumnDef, ...) ([]string, error)
- func DisplayErrorTiming(t time.Time)
- func GetMaxCols() int
- func IterateResults[T queryresult.TimingContainer](result *queryresult.Result[T], displayResult displayResultsFunc[T]) (int, error)
- func ParseJSONOutputColumnValue(val interface{}, col *queryresult.ColumnDef) (interface{}, error)
- func ShowOutput[T queryresult.TimingContainer](ctx context.Context, result *queryresult.Result[T]) (rowCount, rowErrors int)
- func ShowPaged(ctx context.Context, content string)
- func ShowWrappedTable(headers []string, rows [][]string, opts *ShowWrappedTableOptions)
- type ColumnValueOption
- type ShowWrappedTableOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ColumnValueAsString ¶
func ColumnValueAsString(val interface{}, col *queryresult.ColumnDef, opts ...ColumnValueOption) (result string, err error)
ColumnValueAsString converts column value to string
func ColumnValuesAsString ¶
func ColumnValuesAsString(values []interface{}, columns []*queryresult.ColumnDef, opts ...ColumnValueOption) ([]string, error)
ColumnValuesAsString converts a slice of columns into strings
func DisplayErrorTiming ¶
DisplayErrorTiming shows the time taken for the query to fail
func GetMaxCols ¶
func GetMaxCols() int
func IterateResults ¶
func IterateResults[T queryresult.TimingContainer](result *queryresult.Result[T], displayResult displayResultsFunc[T]) (int, error)
call func displayResult for each row of results
func ParseJSONOutputColumnValue ¶
func ParseJSONOutputColumnValue(val interface{}, col *queryresult.ColumnDef) (interface{}, error)
ParseJSONOutputColumnValue segregate data types, ignore string conversion for certain data types : JSON, JSONB, BOOL and so on..
func ShowOutput ¶
func ShowOutput[T queryresult.TimingContainer](ctx context.Context, result *queryresult.Result[T]) (rowCount, rowErrors int)
ShowOutput displays the output using the proper formatter as applicable
func ShowWrappedTable ¶
func ShowWrappedTable(headers []string, rows [][]string, opts *ShowWrappedTableOptions)
Types ¶
type ColumnValueOption ¶
type ColumnValueOption func(opt *columnValueSettings)
func WithNullString ¶
func WithNullString(nullString string) ColumnValueOption
Click to show internal directories.
Click to hide internal directories.