database

package
v1.0.0-rc.5 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoFound = errors.New("not found")

Functions

func NewSqlxRowWithError

func NewSqlxRowWithError(err error) *sqlx.Row

NewSqlxRowWithError uses for testing.

Types

type MasterConnection

type MasterConnection struct {
	QueryerExecerCloser
}

type Pool

type Pool []*sqlx.DB

func (Pool) Close

func (p Pool) Close() error

func (Pool) Exec

func (p Pool) Exec(query string, args ...interface{}) (sql.Result, error)

func (Pool) ExecContext

func (p Pool) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

func (Pool) Query

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

func (Pool) QueryContext

func (p Pool) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)

func (Pool) QueryRowx

func (p Pool) QueryRowx(query string, args ...interface{}) *sqlx.Row

func (Pool) QueryRowxContext

func (p Pool) QueryRowxContext(ctx context.Context, query string, args ...interface{}) *sqlx.Row

func (Pool) Queryx

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

func (Pool) QueryxContext

func (p Pool) QueryxContext(ctx context.Context, query string, args ...interface{}) (*sqlx.Rows, error)

type Queryer

type Queryer interface {
	sqlx.Queryer
	sqlx.QueryerContext
}

type QueryerCloser

type QueryerCloser interface {
	Queryer
	io.Closer
}

type QueryerExecer

type QueryerExecer interface {
	sqlx.Queryer
	sqlx.QueryerContext
	sqlx.Execer
	sqlx.ExecerContext
}

type QueryerExecerCloser

type QueryerExecerCloser interface {
	QueryerExecer
	io.Closer
}

type QueryerExecerMock

type QueryerExecerMock struct {
	mock.Mock
}

QueryerExecerMock is an mock type for the type QueryerExecer

func NewQueryerExecerMock

func NewQueryerExecerMock() *QueryerExecerMock

NewQueryerExecerMock is a constructor.

func (QueryerExecerMock) Exec

func (m QueryerExecerMock) Exec(query string, args ...interface{}) (sql.Result, error)

func (QueryerExecerMock) Query

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

func (QueryerExecerMock) QueryRowx

func (m QueryerExecerMock) QueryRowx(query string, args ...interface{}) *sqlx.Row

func (QueryerExecerMock) Queryx

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

type SlaveConnection

type SlaveConnection struct {
	QueryerCloser
}

Jump to

Keyboard shortcuts

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