mysqldb

package
v2.23.4 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package mysqldb contains database-related functions that are specific to mysql.

Index

Constants

View Source
const MaxRowsReturned int = 1000000000

Variables

This section is empty.

Functions

func ErrorContains

func ErrorContains(err error, needle string) bool

ErrorContains checks whether an error contains a needle.

func IsMysqlError

func IsMysqlError(err error, mysqlErrorNumber MysqlErrorNumber) bool

IsMysqlError checks whether an error is a Mysql error of a certain type.

Types

type MysqlErrorNumber

type MysqlErrorNumber uint16

MysqlErrorNumber represents the code number of a mysql error.

const (
	// DuplicateEntryError represents a mysql Duplicate Entry Error.
	DuplicateEntryError MysqlErrorNumber = 1062
	// LockWaitTimeoutExceededError represents a mysql Lock Wait Timeout Exceeded Error.
	LockWaitTimeoutExceededError MysqlErrorNumber = 1205
	// DeadlockError represents the mysql error "Deadlock found when trying to get lock; try restarting transaction".
	DeadlockError MysqlErrorNumber = 1213
	// ForeignConstraintError represents a mysql Foreign Constraint Error.
	ForeignConstraintError MysqlErrorNumber = 1452
)

Jump to

Keyboard shortcuts

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