sqlbase

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrRetriesExceeded is returned when a transaction is retried more
	// than the max allowed valued without a success.
	ErrRetriesExceeded = errors.New("db tx retries exceeded")
)

Functions

func Init

func Init(maxConnections int)

func IsSerializationError added in v1.4.4

func IsSerializationError(err error) bool

IsSerializationError returns true if the given error is a serialization error.

func MapSQLError added in v1.4.4

func MapSQLError(err error) error

MapSQLError attempts to interpret a given error as a database agnostic SQL error.

func UseLogger

func UseLogger(logger btclog.Logger)

UseLogger uses a specified Logger to output package logging info.

Types

type ErrSQLUniqueConstraintViolation added in v1.4.4

type ErrSQLUniqueConstraintViolation struct {
	DBError error
}

ErrSQLUniqueConstraintViolation is an error type which represents a database agnostic SQL unique constraint violation.

func (ErrSQLUniqueConstraintViolation) Error added in v1.4.4

type ErrSerializationError added in v1.4.4

type ErrSerializationError struct {
	DBError error
}

ErrSerializationError is an error type which represents a database agnostic error that a transaction couldn't be serialized with other concurrent db transactions.

func (ErrSerializationError) Error added in v1.4.4

func (e ErrSerializationError) Error() string

Error returns the error message.

func (ErrSerializationError) Unwrap added in v1.4.4

func (e ErrSerializationError) Unwrap() error

Unwrap returns the wrapped error.

Jump to

Keyboard shortcuts

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