Documentation
¶
Overview ¶
Package queryctx manages per-operation deadlines and result lifetimes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MutationColumns ¶
MutationColumns reports the model fields included in a mutation. The result is non-nil even when every field is omitted, so hooks can distinguish an empty update from a caller that supplied no column metadata.
func Rows ¶
Rows keeps the deadline alive while results are consumed and releases its timer when the caller drains or closes the result set.
func WithTimeout ¶
func WithTimeout(ctx context.Context, opts *driver.DriverOptions) (context.Context, context.CancelFunc)
WithTimeout applies the configured query timeout without extending an earlier caller deadline. Non-positive timeouts leave the caller in control.
Types ¶
type Row ¶
type Row struct {
// contains filtered or unexported fields
}
Row preserves result column metadata for struct scans while retaining the driver's no-rows sentinel and ending telemetry only when Scan or Close runs.
func NewRow ¶
func NewRow(rows driver.Rows, err, noRows error, op *observability.Op, cancel context.CancelFunc) *Row
NewRow takes ownership of rows and cancel, including when err is non-nil.