db

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DriverMysql = "mysql"
	DriverNone  = ""
)
View Source
const (
	RemovedPassword = "[removed]"

	DeadlockDBErrorMessage = "Deadlock found when trying to get lock; try restarting transaction"
	TimeoutDBErrorMessage  = "Lock wait timeout exceeded; try restarting transaction"
)

Variables

This section is empty.

Functions

func ErrIsDuplicateEntryError added in v1.1.0

func ErrIsDuplicateEntryError(err error) bool

func ErrIsLockError added in v1.2.0

func ErrIsLockError(err error) bool

Types

type Conn added in v1.1.0

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

Conn is a wrapper around a dbr connection and a health stream

func New

func New(stream *health.Stream, quietStream *health.Stream, conf cfg.DB, ro bool) (*Conn, error)

New creates a new DB for the given config

func (*Conn) Close added in v1.1.0

func (c *Conn) Close(context.Context) error

func (*Conn) NewQuietSession added in v1.4.1

func (c *Conn) NewQuietSession(name string, timeout time.Duration) (*dbr.Session, error)

func (*Conn) NewSession added in v1.1.0

func (c *Conn) NewSession(name string, timeout time.Duration) (*dbr.Session, error)

func (*Conn) NewSessionForEventReceiver added in v1.1.0

func (c *Conn) NewSessionForEventReceiver(er health.EventReceiver) *dbr.Session

func (*Conn) SetConnMaxIdleTime added in v1.1.3

func (c *Conn) SetConnMaxIdleTime(d time.Duration)

func (*Conn) SetConnMaxLifetime added in v1.1.3

func (c *Conn) SetConnMaxLifetime(d time.Duration)

func (*Conn) SetMaxIdleConns added in v1.1.3

func (c *Conn) SetMaxIdleConns(n int)

func (*Conn) SetMaxOpenConns added in v1.1.3

func (c *Conn) SetMaxOpenConns(n int)

Jump to

Keyboard shortcuts

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