queryresult

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: AGPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QueryRowSummary added in v0.23.0

type QueryRowSummary struct {
	UncachedRowsFetched int64 `db:"uncached_rows_fetched" json:"uncached_rows_fetched"`
	CachedRowsFetched   int64 `db:"cached_rows_fetched" json:"cached_rows_fetched"`
	HydrateCalls        int64 `db:"hydrate_calls" json:"hydrate_calls"`
	ScanCount           int64 `db:"scan_count" json:"scan_count"`
	ConnectionCount     int64 `db:"connection_count" json:"connection_count"`
	// contains filtered or unexported fields
}

func NewQueryRowSummary added in v0.23.0

func NewQueryRowSummary() *QueryRowSummary

func (*QueryRowSummary) AsResultRow added in v0.23.0

func (s *QueryRowSummary) AsResultRow() map[string]any

func (*QueryRowSummary) Update added in v0.23.0

func (s *QueryRowSummary) Update(m ScanMetadataRow)

type Result

Result is a type alias for queryresult.Result[TimingResultStream]

func NewResult added in v0.17.0

func NewResult(cols []*queryresult.ColumnDef) *Result

type ResultStreamer

ResultStreamer is a type alias for queryresult.ResultStreamer[TimingResultStream]

func NewResultStreamer

func NewResultStreamer() *ResultStreamer

type ScanMetadataRow added in v0.23.0

type ScanMetadataRow struct {
	// the fields of this struct need to be public since these are populated by pgx using RowsToStruct
	Connection   string                  `db:"connection,optional" json:"connection"`
	Table        string                  `db:"table"  json:"table"`
	CacheHit     bool                    `db:"cache_hit"  json:"cache_hit"`
	RowsFetched  int64                   `db:"rows_fetched" json:"rows_fetched"`
	HydrateCalls int64                   `db:"hydrate_calls" json:"hydrate_calls"`
	StartTime    time.Time               `db:"start_time" json:"start_time"`
	DurationMs   int64                   `db:"duration_ms" json:"duration_ms"`
	Columns      []string                `db:"columns" json:"columns"`
	Limit        *int64                  `db:"limit" json:"limit,omitempty"`
	Quals        []grpc.SerializableQual `db:"quals" json:"quals,omitempty"`
}

func NewScanMetadataRow added in v0.23.0

func NewScanMetadataRow(connection string, table string, columns []string, quals map[string]*proto.Quals, startTime time.Time, diration time.Duration, limit int64, m *proto.QueryMetadata) ScanMetadataRow

func (ScanMetadataRow) AsResultRow added in v0.23.0

func (m ScanMetadataRow) AsResultRow() map[string]any

AsResultRow returns the ScanMetadata as a map[string]interface which can be returned as a query result

type TimingResult

type TimingResult struct {
	DurationMs          int64              `json:"duration_ms"`
	Scans               []*ScanMetadataRow `json:"scans"`
	ScanCount           int64              `json:"scan_count,omitempty"`
	RowsReturned        int64              `json:"rows_returned"`
	UncachedRowsFetched int64              `json:"uncached_rows_fetched"`
	CachedRowsFetched   int64              `json:"cached_rows_fetched"`
	HydrateCalls        int64              `json:"hydrate_calls"`
	ConnectionCount     int64              `json:"connection_count"`
}

func (TimingResult) GetTiming added in v1.0.0

func (t TimingResult) GetTiming() any

GetTiming implements TimingContainer

func (*TimingResult) Initialise added in v0.23.0

func (r *TimingResult) Initialise(summary *QueryRowSummary, scans []*ScanMetadataRow)

type TimingResultStream added in v1.0.0

type TimingResultStream struct {
	Stream chan *TimingResult
}

func NewTimingResultStream added in v1.0.0

func NewTimingResultStream() TimingResultStream

func (TimingResultStream) GetTiming added in v1.0.0

func (t TimingResultStream) GetTiming() any

GetTiming implements TimingContainer

func (TimingResultStream) SetTiming added in v1.0.0

func (t TimingResultStream) SetTiming(result *TimingResult)

Jump to

Keyboard shortcuts

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