Package dbtrace counts database calls per request and logs the heavy ones.
It is off until Configure enables it; the hot-path helpers are no-ops for
contexts without a tracker.
Connection use per request ≈ tx + pooled + raw (each pooled/raw call takes
its own pool connection; calls inside RunInTransaction share the tx's).
Middleware tracks every request and logs those over the configured
thresholds once the handler returns. Options are read per request, so
Configure can toggle it at runtime. Raw calls made by detached goroutines
after the response (e.g. session activity) are not included in the log line.
type Options struct {
Enabled bool MinCalls int// log when tx+pooled+raw >= MinCalls MinDuration time.Duration// or when the request took at least this (0 = off) PoolLog bool// log pool deltas on each dbmanager metrics publish}