mocks

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OnExecCb added in v0.7.0

type OnExecCb func(ctx context.Context, query string, args ...any)

type OnSelectCb added in v0.7.0

type OnSelectCb func(ctx context.Context, dest any, query string, args ...any)

type SQLExecutor

type SQLExecutor struct {
	mock.Mock
	// contains filtered or unexported fields
}

func NewSQLExecutor

func NewSQLExecutor() *SQLExecutor

func (*SQLExecutor) Exec

func (m *SQLExecutor) Exec(ctx context.Context, query string, args ...any) (sql.Result, error)

func (*SQLExecutor) SelectMany

func (m *SQLExecutor) SelectMany(ctx context.Context, dest any, query string, args ...any) error

func (*SQLExecutor) SelectOne

func (m *SQLExecutor) SelectOne(ctx context.Context, dest any, query string, args ...any) error

func (*SQLExecutor) SetOnExecCb added in v0.7.0

func (m *SQLExecutor) SetOnExecCb(cb OnExecCb)

func (*SQLExecutor) SetOnSelectManyCb added in v0.7.0

func (m *SQLExecutor) SetOnSelectManyCb(cb OnSelectCb)

func (*SQLExecutor) SetOnSelectOneCb added in v0.7.0

func (m *SQLExecutor) SetOnSelectOneCb(cb OnSelectCb)

type SQLResult

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

func NewSQLResult

func NewSQLResult(lastInsertId int64, rowsAffected int64) *SQLResult

func (*SQLResult) LastInsertId

func (r *SQLResult) LastInsertId() (int64, error)

func (*SQLResult) RowsAffected

func (r *SQLResult) RowsAffected() (int64, error)

Jump to

Keyboard shortcuts

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