Documentation
¶
Overview ¶
Package driver wraps a database/sql/driver so that statements run through it are recorded on the querytrace.Trace carried by their context. It is the generic, driver-level integration: it works with any database/sql driver and, by wrapping the row cursor, captures the rows lifecycle (iteration and close timing) that the query call alone hides.
Wrap a driver.Connector and open a database/sql handle over it:
db := sql.OpenDB(querytracedriver.WrapConnector(connector, querytrace.DebugConfig("postgres")))
A statement is recorded only when its context carries a Trace (see querytrace.WithTrace) and the Config is enabled; otherwise the wrapper is a thin pass-through.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WrapConnector ¶
WrapConnector wraps c so statements run over the connections it produces are recorded against the querytrace.Trace in their context, using cfg. Open a database/sql handle over the result with sql.OpenDB.
Types ¶
This section is empty.