util

package
v0.0.0-...-41c8d9c Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleError

func HandleError(desc string, err error) error

HandleError logs an error with an extra description and masks the error if it's an SQL one. The function ensures we never return plain SQL errors and leak anything. The function should be used for every database query error.

func IsErrUniqueViolation

func IsErrUniqueViolation(err error) bool

IsErrUniqueViolation determines is the given error is a unique contraint violation.

func QueryInsert

func QueryInsert(count int, table string, columns ...string) string

func QueryPersist

func QueryPersist(count int, table, constraint string, columns ...string) string

func QueryString

func QueryString(keySize, arraySize int) string

size of key and array should be both greater than 0

Types

This section is empty.

Jump to

Keyboard shortcuts

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