internal

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package internal contains tblfmt internals.

Index

Constants

View Source
const Divider = "==============================================="

Divider is a divider.

Variables

This section is empty.

Functions

func PsqlEncode

func PsqlEncode(w io.Writer, resultSet ResultSet, params map[string]string, dsn string) error

PsqlEncode runs one values query with psql. It writes the output that it captures to the writer.

func PsqlEncodeAll

func PsqlEncodeAll(w io.Writer, resultSet ResultSet, params map[string]string, dsn string) error

PsqlEncodeAll runs one values query in psql for each result set. It writes the output that it captures to the writer.

Types

type RS added in v0.13.0

type RS struct {
	// contains filtered or unexported fields
}

RS is a result set.

func Big added in v0.13.0

func Big(seed int64) *RS

Big creates a random, big result set using the provided seed.

func Multi added in v0.13.0

func Multi() *RS

Multi creates a result set with multiple result sets.

func New added in v0.13.0

func New(cols []string, vals ...[][]any) *RS

New creates a new result set.

func Tiny added in v0.13.0

func Tiny() *RS

Tiny creates a tiny result set.

func Wide added in v0.13.0

func Wide() *RS

Wide creates a wide result set.

func (*RS) Close added in v0.13.0

func (*RS) Close() error

Close satisfies the ResultSet interface.

func (*RS) Columns added in v0.13.0

func (r *RS) Columns() ([]string, error)

Columns satisfies the ResultSet interface.

func (*RS) Err added in v0.13.0

func (*RS) Err() error

Err satisfies the ResultSet interface.

func (*RS) Next added in v0.13.0

func (r *RS) Next() bool

Next satisfies the ResultSet interface.

func (*RS) NextResultSet added in v0.13.0

func (r *RS) NextResultSet() bool

NextResultSet satisfies the ResultSet interface.

func (*RS) Reset added in v0.13.0

func (r *RS) Reset()

Reset resets the result set, so that it can be used again.

func (*RS) Scan added in v0.13.0

func (r *RS) Scan(vals ...any) error

Scan satisfies the ResultSet interface.

type ResultSet

type ResultSet interface {
	Next() bool
	Scan(...any) error
	Columns() ([]string, error)
	Close() error
	Err() error
	NextResultSet() bool
}

ResultSet is the shared interface for a result set.

Jump to

Keyboard shortcuts

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