Help us shape the future of Go! Take the 2026 Go Developer Survey

driver

package
v1.31.5 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver interface {
	CreateConnection(dsn string) (*sqlx.DB, error)
	// CreateRefreshableConnection creates a connection pool that calls buildDSN
	// before opening each new physical connection, enabling per-connection
	// credential refresh for short-lived tokens (e.g. from passwordCommand).
	CreateRefreshableConnection(buildDSN func() (string, error)) (*sqlx.DB, error)
	IsDupEntryError(error) bool
	IsDupDatabaseError(error) bool
	IsConnNeedsRefreshError(error) bool
}

type PGXDriver

type PGXDriver struct{}

func (*PGXDriver) CreateConnection

func (p *PGXDriver) CreateConnection(dsn string) (*sqlx.DB, error)

func (*PGXDriver) CreateRefreshableConnection added in v1.31.0

func (p *PGXDriver) CreateRefreshableConnection(buildDSN func() (string, error)) (*sqlx.DB, error)

func (*PGXDriver) IsConnNeedsRefreshError added in v1.25.0

func (p *PGXDriver) IsConnNeedsRefreshError(err error) bool

func (*PGXDriver) IsDupDatabaseError

func (p *PGXDriver) IsDupDatabaseError(err error) bool

func (*PGXDriver) IsDupEntryError

func (p *PGXDriver) IsDupEntryError(err error) bool

type PQDriver

type PQDriver struct{}

func (*PQDriver) CreateConnection

func (p *PQDriver) CreateConnection(dsn string) (*sqlx.DB, error)

func (*PQDriver) CreateRefreshableConnection added in v1.31.0

func (p *PQDriver) CreateRefreshableConnection(buildDSN func() (string, error)) (*sqlx.DB, error)

func (*PQDriver) IsConnNeedsRefreshError added in v1.25.0

func (p *PQDriver) IsConnNeedsRefreshError(err error) bool

func (*PQDriver) IsDupDatabaseError

func (p *PQDriver) IsDupDatabaseError(err error) bool

func (*PQDriver) IsDupEntryError

func (p *PQDriver) IsDupEntryError(err error) bool

Jump to

Keyboard shortcuts

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