result

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecResult

type ExecResult struct {
	RowsAffected int64
	Status       string
	Duration     time.Duration
}

ExecResult represents a non-row SQL command result (INSERT, UPDATE, DELETE, DDL).

func NewExec

func NewExec(tag pgconn.CommandTag, duration time.Duration) *ExecResult

func (*ExecResult) Type

func (e *ExecResult) Type() Type

type QueryResult

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

QueryResult represents a row-producing SQL execution result.

func NewQuery

func NewQuery(rows pgx.Rows, duration time.Duration) *QueryResult

func (*QueryResult) Caption

func (r *QueryResult) Caption() string

func (*QueryResult) Close

func (r *QueryResult) Close() error

func (*QueryResult) Columns

func (r *QueryResult) Columns() []string

func (*QueryResult) CommandTag

func (r *QueryResult) CommandTag() string

CommandTag returns the PostgreSQL command tag for the streamed rows.

func (*QueryResult) Duration

func (r *QueryResult) Duration() time.Duration

func (*QueryResult) Next

func (r *QueryResult) Next() ([]any, error)

Next returns the next row as []any or io.EOF when done.

func (*QueryResult) Rows

func (r *QueryResult) Rows() ([][]any, error)

func (*QueryResult) Type

func (r *QueryResult) Type() Type

type Result

type Result interface {
	Type() Type
}

Result marks values returned by SQL execution paths.

type SpecialRow

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

SpecialRow stores row-oriented special command output as plain values.

func NewSpecialRow

func NewSpecialRow(rows pgx.Rows) (SpecialRow, error)

func (SpecialRow) Columns

func (r SpecialRow) Columns() []string

Columns returns row header names.

func (SpecialRow) Data

func (r SpecialRow) Data() [][]any

Data returns row values.

func (SpecialRow) ResultKind

func (r SpecialRow) ResultKind() pgxspecial.SpecialResultKind

ResultKind marks this result as a row-based special command output.

type Type

type Type int
const (
	ResultTypeQuery Type = iota
	ResultTypeExec
	ResultTypeSpecial
)

Jump to

Keyboard shortcuts

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