Versions in this module Expand all Collapse all v3 v3.2.1 Nov 21, 2023 Changes in this version + var CSVColumnParser = func(s string) interface{} + func NewResult(op string, rowsAffected int64) pgconn.CommandTag + func QueryMatcherOption(queryMatcher QueryMatcher) func(*pgxmock) error + type Argument interface + Match func(interface{}) bool + func AnyArg() Argument + type CallModifyer interface + Maybe func() CallModifyer + Times func(n uint) CallModifyer + WillDelayFor func(duration time.Duration) CallModifyer + WillPanic func(v any) + WillReturnError func(err error) + type Expectation interface + type ExpectationType interface + type ExpectedBegin struct + func (e *ExpectedBegin) Maybe() CallModifyer + func (e *ExpectedBegin) String() string + func (e *ExpectedBegin) Times(n uint) CallModifyer + func (e *ExpectedBegin) WillDelayFor(duration time.Duration) CallModifyer + func (e *ExpectedBegin) WillPanic(v any) + func (e *ExpectedBegin) WillReturnError(err error) + type ExpectedClose struct + func (e *ExpectedClose) Maybe() CallModifyer + func (e *ExpectedClose) String() string + func (e *ExpectedClose) Times(n uint) CallModifyer + func (e *ExpectedClose) WillDelayFor(duration time.Duration) CallModifyer + func (e *ExpectedClose) WillPanic(v any) + func (e *ExpectedClose) WillReturnError(err error) + type ExpectedCommit struct + func (e *ExpectedCommit) Maybe() CallModifyer + func (e *ExpectedCommit) String() string + func (e *ExpectedCommit) Times(n uint) CallModifyer + func (e *ExpectedCommit) WillDelayFor(duration time.Duration) CallModifyer + func (e *ExpectedCommit) WillPanic(v any) + func (e *ExpectedCommit) WillReturnError(err error) + type ExpectedCopyFrom struct + func (e *ExpectedCopyFrom) Maybe() CallModifyer + func (e *ExpectedCopyFrom) String() string + func (e *ExpectedCopyFrom) Times(n uint) CallModifyer + func (e *ExpectedCopyFrom) WillDelayFor(duration time.Duration) CallModifyer + func (e *ExpectedCopyFrom) WillPanic(v any) + func (e *ExpectedCopyFrom) WillReturnError(err error) + func (e *ExpectedCopyFrom) WillReturnResult(result int64) *ExpectedCopyFrom + type ExpectedExec struct + func (e *ExpectedExec) Maybe() CallModifyer + func (e *ExpectedExec) String() string + func (e *ExpectedExec) Times(n uint) CallModifyer + func (e *ExpectedExec) WillDelayFor(duration time.Duration) CallModifyer + func (e *ExpectedExec) WillPanic(v any) + func (e *ExpectedExec) WillReturnError(err error) + func (e *ExpectedExec) WillReturnResult(result pgconn.CommandTag) *ExpectedExec + func (e *ExpectedExec) WithArgs(args ...interface{}) *ExpectedExec + func (e *ExpectedExec) WithRewrittenSQL(sql string) *ExpectedExec + type ExpectedPing struct + func (e *ExpectedPing) Maybe() CallModifyer + func (e *ExpectedPing) String() string + func (e *ExpectedPing) Times(n uint) CallModifyer + func (e *ExpectedPing) WillDelayFor(duration time.Duration) CallModifyer + func (e *ExpectedPing) WillPanic(v any) + func (e *ExpectedPing) WillReturnError(err error) + type ExpectedPrepare struct + func (e *ExpectedPrepare) ExpectExec() *ExpectedExec + func (e *ExpectedPrepare) ExpectQuery() *ExpectedQuery + func (e *ExpectedPrepare) Maybe() CallModifyer + func (e *ExpectedPrepare) String() string + func (e *ExpectedPrepare) Times(n uint) CallModifyer + func (e *ExpectedPrepare) WillBeClosed() *ExpectedPrepare + func (e *ExpectedPrepare) WillBeDeallocated() *ExpectedPrepare + func (e *ExpectedPrepare) WillDelayFor(duration time.Duration) CallModifyer + func (e *ExpectedPrepare) WillPanic(v any) + func (e *ExpectedPrepare) WillReturnCloseError(err error) *ExpectedPrepare + func (e *ExpectedPrepare) WillReturnError(err error) + type ExpectedQuery struct + func (e *ExpectedQuery) Maybe() CallModifyer + func (e *ExpectedQuery) RowsWillBeClosed() *ExpectedQuery + func (e *ExpectedQuery) String() string + func (e *ExpectedQuery) Times(n uint) CallModifyer + func (e *ExpectedQuery) WillDelayFor(duration time.Duration) CallModifyer + func (e *ExpectedQuery) WillPanic(v any) + func (e *ExpectedQuery) WillReturnError(err error) + func (e *ExpectedQuery) WillReturnRows(rows ...*Rows) *ExpectedQuery + func (e *ExpectedQuery) WithArgs(args ...interface{}) *ExpectedQuery + func (e *ExpectedQuery) WithRewrittenSQL(sql string) *ExpectedQuery + type ExpectedReset struct + func (e *ExpectedReset) Maybe() CallModifyer + func (e *ExpectedReset) String() string + func (e *ExpectedReset) Times(n uint) CallModifyer + func (e *ExpectedReset) WillDelayFor(duration time.Duration) CallModifyer + func (e *ExpectedReset) WillPanic(v any) + func (e *ExpectedReset) WillReturnError(err error) + type ExpectedRollback struct + func (e *ExpectedRollback) Maybe() CallModifyer + func (e *ExpectedRollback) String() string + func (e *ExpectedRollback) Times(n uint) CallModifyer + func (e *ExpectedRollback) WillDelayFor(duration time.Duration) CallModifyer + func (e *ExpectedRollback) WillPanic(v any) + func (e *ExpectedRollback) WillReturnError(err error) + type PgxConnIface interface + Close func(ctx context.Context) error + Deallocate func(ctx context.Context, name string) error + func NewConn(options ...func(*pgxmock) error) (PgxConnIface, error) + type PgxPoolIface interface + Acquire func(ctx context.Context) (*pgxpool.Conn, error) + AcquireAllIdle func(ctx context.Context) []*pgxpool.Conn + AcquireFunc func(ctx context.Context, f func(*pgxpool.Conn) error) error + AsConn func() PgxConnIface + Close func() + Reset func() + Stat func() *pgxpool.Stat + func NewPool(options ...func(*pgxmock) error) (PgxPoolIface, error) + type QueryMatcher interface + Match func(expectedSQL, actualSQL string) error + var QueryMatcherEqual QueryMatcher = QueryMatcherFunc(func(expectedSQL, actualSQL string) error { ... }) + var QueryMatcherRegexp QueryMatcher = QueryMatcherFunc(func(expectedSQL, actualSQL string) error { ... }) + type QueryMatcherFunc func(expectedSQL, actualSQL string) error + func (f QueryMatcherFunc) Match(expectedSQL, actualSQL string) error + type Rows struct + func NewRows(columns []string) *Rows + func NewRowsWithColumnDefinition(columns ...pgconn.FieldDescription) *Rows + func (r *Rows) AddCommandTag(tag pgconn.CommandTag) *Rows + func (r *Rows) AddRow(values ...any) *Rows + func (r *Rows) AddRows(values ...[]any) *Rows + func (r *Rows) CloseError(err error) *Rows + func (r *Rows) FromCSVString(s string) *Rows + func (r *Rows) Kind() pgx.Rows + func (r *Rows) RowError(row int, err error) *Rows