db

package
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EndTx

func EndTx(tx *sql.Tx, err error) error

EndTx ends transaction according error without shadowing given error

func GetTx

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

GetTx return given transaction if not nil or create a new one

func New

func New(config Config) (*sql.DB, error)

New creates new App from Config

func Ping

func Ping(db *sql.DB) bool

Ping indicate if database is ready or not

func PrepareFullTextSearch

func PrepareFullTextSearch(query, search string, index uint) (string, string)

PrepareFullTextSearch replace $INDEX param in query and expand words

func RowsClose

func RowsClose(rows *sql.Rows, err error) error

RowsClose closes rows without shadowing error

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config of package

func Flags

func Flags(fs *flag.FlagSet, prefix string) Config

Flags adds flags for configuring package

type WhereInUint

type WhereInUint []uint

WhereInUint wrapper for assigning "IN ($n)" in WHERE clause

func (WhereInUint) Value

func (a WhereInUint) Value() (driver.Value, error)

Value implements the driver.Valuer interface.

Jump to

Keyboard shortcuts

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