mysqldb

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

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
	// LockDeadlockError represents a mysql Lock Deadlock Error.
	LockDeadlockError 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