Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type QueryRowSummary ¶
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 ¶
func NewQueryRowSummary() *QueryRowSummary
func (*QueryRowSummary) AsResultRow ¶
func (s *QueryRowSummary) AsResultRow() map[string]any
func (*QueryRowSummary) Update ¶
func (s *QueryRowSummary) Update(m ScanMetadataRow)
type Result ¶
type Result struct {
*queryresult.Result[TimingResultStream]
// contains filtered or unexported fields
}
Result wraps queryresult.Result[TimingResultStream] with idempotent Close() and synchronization to prevent race between StreamRow and Close
func NewResult ¶
func NewResult(cols []*queryresult.ColumnDef) *Result
func WrapResult ¶ added in v2.3.3
func WrapResult(r *queryresult.Result[TimingResultStream]) *Result
WrapResult wraps a pipe-fittings Result with our wrapper that has idempotent Close
type ResultStreamer ¶
type ResultStreamer = queryresult.ResultStreamer[TimingResultStream]
ResultStreamer is a type alias for queryresult.ResultStreamer[TimingResultStream]
func NewResultStreamer ¶
func NewResultStreamer() *ResultStreamer
type ScanMetadataRow ¶
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 ¶
func (ScanMetadataRow) AsResultRow ¶
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 ¶
func (t TimingResult) GetTiming() any
GetTiming implements TimingContainer
func (*TimingResult) Initialise ¶
func (r *TimingResult) Initialise(summary *QueryRowSummary, scans []*ScanMetadataRow)
type TimingResultStream ¶
type TimingResultStream struct {
Stream chan *TimingResult
}
func NewTimingResultStream ¶
func NewTimingResultStream() TimingResultStream
func (TimingResultStream) GetTiming ¶
func (t TimingResultStream) GetTiming() any
GetTiming implements TimingContainer
func (TimingResultStream) SetTiming ¶
func (t TimingResultStream) SetTiming(result *TimingResult)
Click to show internal directories.
Click to hide internal directories.