mysql

package
v0.0.0-...-f999dd2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package mysql provides the library to communicate to mysql

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(datasource string, maxactive, maxidle int) (*sqlx.DB, error)

Connect initializes mysql DB

Types

type RetryDB

type RetryDB struct {
	*sqlx.DB
	// contains filtered or unexported fields
}

func ConnectWithRetry

func ConnectWithRetry(datasource string, maxactive, maxidle int) (*RetryDB, error)

Connect initializes mysql DB

func (*RetryDB) Exec

func (rdb *RetryDB) Exec(query string, args ...interface{}) (sql.Result, error)

func (*RetryDB) Get

func (rdb *RetryDB) Get(dest interface{}, query string, args ...interface{}) error

func (*RetryDB) NamedExec

func (rdb *RetryDB) NamedExec(query string, arg interface{}) (sql.Result, error)

func (*RetryDB) NamedQuery

func (rdb *RetryDB) NamedQuery(query string, arg interface{}) (*sqlx.Rows, error)

func (*RetryDB) PrepareNamed

func (rdb *RetryDB) PrepareNamed(query string) (*RetryNamedStmt, error)

func (*RetryDB) Preparex

func (rdb *RetryDB) Preparex(query string) (*RetryStmt, error)

func (*RetryDB) Query

func (rdb *RetryDB) Query(query string, args ...interface{}) (*sql.Rows, error)

func (*RetryDB) Queryx

func (rdb *RetryDB) Queryx(query string, args ...interface{}) (*sqlx.Rows, error)

func (*RetryDB) Select

func (rdb *RetryDB) Select(dest interface{}, query string, args ...interface{}) error

type RetryNamedStmt

type RetryNamedStmt struct {
	Stmt *sqlx.NamedStmt
	// contains filtered or unexported fields
}

func (*RetryNamedStmt) Close

func (n *RetryNamedStmt) Close() error

func (*RetryNamedStmt) Exec

func (n *RetryNamedStmt) Exec(arg interface{}) (sql.Result, error)

func (*RetryNamedStmt) Get

func (n *RetryNamedStmt) Get(dest interface{}, arg interface{}) error

Get using this NamedStmt

func (*RetryNamedStmt) MustExec

func (n *RetryNamedStmt) MustExec(arg interface{}) sql.Result

func (*RetryNamedStmt) Query

func (n *RetryNamedStmt) Query(args interface{}) (*sql.Rows, error)

func (*RetryNamedStmt) QueryRow

func (n *RetryNamedStmt) QueryRow(arg interface{}) *sqlx.Row

func (*RetryNamedStmt) QueryRowx

func (n *RetryNamedStmt) QueryRowx(arg interface{}) *sqlx.Row

func (*RetryNamedStmt) Queryx

func (n *RetryNamedStmt) Queryx(args interface{}) (*sqlx.Rows, error)

func (*RetryNamedStmt) Select

func (n *RetryNamedStmt) Select(dest interface{}, arg interface{}) error

func (*RetryNamedStmt) Unsafe

func (n *RetryNamedStmt) Unsafe() *RetryNamedStmt

type RetryStmt

type RetryStmt struct {
	*sqlx.Stmt
	// contains filtered or unexported fields
}

func (*RetryStmt) Exec

func (rs *RetryStmt) Exec(arg interface{}) (sql.Result, error)

func (*RetryStmt) Get

func (rs *RetryStmt) Get(dest interface{}, args ...interface{}) error

Get using the prepared statement.

func (*RetryStmt) Query

func (rs *RetryStmt) Query(args ...interface{}) (*sql.Rows, error)

func (*RetryStmt) Select

func (rs *RetryStmt) Select(dest interface{}, args ...interface{}) error

func (*RetryStmt) Unsafe

func (rs *RetryStmt) Unsafe() *RetryStmt

Jump to

Keyboard shortcuts

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