driver

package standard library
go1.25.5 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: BSD-3-Clause Imports: 6 Imported by: 32,482

Documentation

Overview

Package driver defines interfaces to be implemented by database drivers as used by package sql.

Most code should use the database/sql package.

The driver interface has evolved over time. Drivers should implement Connector and DriverContext interfaces. The Connector.Connect and Driver.Open methods should never return ErrBadConn. ErrBadConn should only be returned from Validator, SessionResetter, or a query method if the connection is already in an invalid (e.g. closed) state.

All Conn implementations should implement the following interfaces: Pinger, SessionResetter, and Validator.

If named parameters or context are supported, the driver's