sql

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UniqueViolationCode = "23505"
)

Variables

View Source
var (
	ErrNilQuery = errors.New("sql query cannot be nil")
	ErrNilRow   = errors.New("sql row cannot be nil")
)

Functions

func CreateTransaction

func CreateTransaction(db *sql.DB, fn func(tx *sql.Tx) error) error

CreateTransaction creates a transaction for the database

func IsUniqueViolationError added in v0.4.3

func IsUniqueViolationError(err error) (bool, string)

IsUniqueViolationError checks if the error is a unique violation error

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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