driver

package
v0.0.0-...-de5c544 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 7 Imported by: 0

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

func WrapConnector(c stddriver.Connector, cfg qt.Config) stddriver.Connector

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.

Jump to

Keyboard shortcuts

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