test

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StubExecer

type StubExecer struct {
	N    int64
	Row  sqlapi.SqlRow
	Rows sqlapi.SqlRows
	Err  error
	Lgr  sqlapi.Logger
	Di   dialect.Dialect
}

StubExecer provides a non-functioning Execer for testing purposes.

func (StubExecer) Close

func (e StubExecer) Close() error

func (StubExecer) Commit

func (e StubExecer) Commit() error

func (StubExecer) Dialect

func (e StubExecer) Dialect() dialect.Dialect

func (StubExecer) ExecContext

func (e StubExecer) ExecContext(ctx context.Context, query string, args ...interface{}) (int64, error)

func (StubExecer) InsertContext

func (e StubExecer) InsertContext(ctx context.Context, pk, query string, args ...interface{}) (int64, error)

func (StubExecer) IsTx

func (StubExecer) IsTx() bool

func (StubExecer) Logger

func (e StubExecer) Logger() sqlapi.Logger

func (StubExecer) PingContext

func (e StubExecer) PingContext(_ context.Context) error

func (StubExecer) PrepareContext

func (e StubExecer) PrepareContext(ctx context.Context, name, query string) (sqlapi.SqlStmt, error)

func (StubExecer) QueryContext

func (e StubExecer) QueryContext(ctx context.Context, query string, args ...interface{}) (sqlapi.SqlRows, error)

func (StubExecer) QueryRowContext

func (e StubExecer) QueryRowContext(ctx context.Context, query string, args ...interface{}) sqlapi.SqlRow

func (StubExecer) Rollback

func (e StubExecer) Rollback() error

func (StubExecer) SingleConn

func (e StubExecer) SingleConn(_ context.Context, fn func(ex sqlapi.Execer) error) error

func (StubExecer) Stats

func (e StubExecer) Stats() sqlapi.DBStats

func (StubExecer) Transact

func (e StubExecer) Transact(_ context.Context, txOptions *sql.TxOptions, fn func(sqlapi.SqlTx) error) error

type StubLogger

type StubLogger struct {
	Logged []string
}

StubLogger provides a non-functioning sqlapi.StdLog for testing purposes. It captures all the lines logged.

func (*StubLogger) Printf

func (r *StubLogger) Printf(format string, v ...interface{})

type StubRow

type StubRow []interface{}

StubRow provides a non-functioning pgxapi.SqlRow for testing purposes.

func (StubRow) Scan

func (r StubRow) Scan(dest ...interface{}) error

type StubRows

type StubRows struct {
	I     int
	Rows  []StubRow
	Error error
	Cols  []string
	Types []*sql.ColumnType
}

StubRow provides a non-functioning pgxapi.SqlRows for testing purposes.

func (*StubRows) Close

func (r *StubRows) Close() error

func (*StubRows) ColumnTypes

func (r *StubRows) ColumnTypes() ([]*sql.ColumnType, error)

func (*StubRows) Columns

func (r *StubRows) Columns() ([]string, error)

func (*StubRows) Err

func (r *StubRows) Err() error

func (*StubRows) Next

func (r *StubRows) Next() bool

func (*StubRows) Scan

func (r *StubRows) Scan(dest ...interface{}) error

Jump to

Keyboard shortcuts

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