sqldrv

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppURL added in v0.31.1

func AppURL(urlStr, appName string) (string, error)

AppURL will add the application_name parameter to the provided URL.

func NewConnector

func NewConnector(urlStr, appName string) (driver.Connector, error)

NewConnector will create a new driver.Connector with retry enabled and the provided application_name.

func NewDB

func NewDB(urlStr, appName string) (*sql.DB, error)

NewDB is a convenience function for creating a *sql.DB from a DB URL and application_name.

Types

type RetryDriver

type RetryDriver struct {
	// contains filtered or unexported fields
}

RetryDriver will wrap a driver.Driver so that all new connections will be retried on temporary errors.

func NewRetryDriver

func NewRetryDriver(drv driver.Driver, retryLimit int) *RetryDriver

NewRetryDriver returns a new RetryDriver with the provided connection retry limit.

func (*RetryDriver) Open

func (rd *RetryDriver) Open(name string) (driver.Conn, error)

func (*RetryDriver) OpenConnector

func (rd *RetryDriver) OpenConnector(name string) (driver.Connector, error)

Jump to

Keyboard shortcuts

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