sql

package
v0.0.0-...-153d94f Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2018 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MySQLBypassDupError

func MySQLBypassDupError(err error) error

MySQLBypassDupError if err is a MySQL duplicate error nil will be returned. All other errors are returned.

func MySQLIsDupError

func MySQLIsDupError(err error) bool

MySQLIsDupError checks whether err is a MySQL duplicate error.

func StringsToIN

func StringsToIN(strs []string) string

StringsToIN converts strings to an "IN type" that can be used for SQL. Be aware that this is NOT SQL injection safe.

func Transactional

func Transactional(db *sql.DB, fns ...func(tx *sql.Tx) (err error)) (err error)

func Uint64ToIN

func Uint64ToIN(ids []uint64) string

Uint64ToIN converts uint64s to an "IN type" that can be used for SQL. Be aware that this is NOT SQL injection safe.

Types

type SQLExecutor

type SQLExecutor interface {
	Exec(query string, args ...interface{}) (sql.Result, error)
}

type SQLExecutorQuerier

type SQLExecutorQuerier interface {
	SQLExecutor
	SQLQuerier
}

type SQLQuerier

type SQLQuerier interface {
	Query(query string, args ...interface{}) (*sql.Rows, error)
	QueryRow(query string, args ...interface{}) *sql.Row
}

type SQLStringer

type SQLStringer interface {
	SQLString() string
}

Jump to

Keyboard shortcuts

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