sqlassist

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecStubber

type ExecStubber struct {
	Args   []driver.Value
	Expect string
	Err    error
	Result driver.Result
}

ExecStubber is the actor which performs stubs of db.Exec()

func (*ExecStubber) Stub

func (exec *ExecStubber) Stub(mock sqlmock.Sqlmock) *sqlmock.ExpectedExec

Stub stubs the execution with the given mock It uses .Err to provide connection errs, and Result to stub the desired output on caller

type QueryStubber

type QueryStubber struct {
	Expect string
	Args   []driver.Value
	Err    error
	Rows   *sqlmock.Rows
}

QueryStubber is the actor which performs stubs of db.Query()

func (*QueryStubber) Stub

func (query *QueryStubber) Stub(mock sqlmock.Sqlmock) *sqlmock.ExpectedQuery

Stub stubs the query with the given mock It uses .Err to provide connection errs, and Rows to stub the desired output on caller

Jump to

Keyboard shortcuts

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