database

package
v0.1.219 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorCode

func ErrorCode(err error) string

ErrorCode extracts the error code from the given error returned by a database operation. It uses reflection to get the value of the `Code` field in order to avoid having to import the `lib/pq` and `pgx` packages. It returns an empty string if the passed error is nil or it hasn't the `Code` field.

Types

This section is empty.

Jump to

Keyboard shortcuts

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