Versions in this module Expand all Collapse all v1 v1.5.0 Jul 1, 2022 Changes in this version + var CSVColumnParser = func(s string) []byte + var ErrCancelled = errors.New("canceling query due to user request") + func MonitorPingsOption(monitorPings bool) func(*sqlmock) error + func NewErrorResult(err error) driver.Result + func NewResult(lastInsertID int64, rowsAffected int64) driver.Result + func QueryMatcherOption(queryMatcher QueryMatcher) func(*sqlmock) error + func ValueConverterOption(converter driver.ValueConverter) func(*sqlmock) error + type Argument interface + Match func(driver.Value) bool + func AnyArg() Argument + type Column struct + func NewColumn(name string) *Column + func (c *Column) DbType() string + func (c *Column) IsNullable() (bool, bool) + func (c *Column) Length() (int64, bool) + func (c *Column) Name() string + func (c *Column) Nullable(nullable bool) *Column + func (c *Column) OfType(dbType string, sampleValue interface{}) *Column + func (c *Column) PrecisionScale() (int64, int64, bool) + func (c *Column) ScanType() reflect.Type + func (c *Column) WithLength(length int64) *Column + func (c *Column) WithPrecisionAndScale(precision, scale int64) *Column + type ExpectedBegin struct + func (e *ExpectedBegin) String() string + func (e *ExpectedBegin) WillDelayFor(duration time.Duration) *ExpectedBegin + func (e *ExpectedBegin) WillReturnError(err error) *ExpectedBegin + type ExpectedClose struct + func (e *ExpectedClose) String() string + func (e *ExpectedClose) WillReturnError(err error) *ExpectedClose + type ExpectedCommit struct + func (e *ExpectedCommit) String() string + func (e *ExpectedCommit) WillReturnError(err error) *ExpectedCommit + type ExpectedExec struct + func (e *ExpectedExec) String() string + func (e *ExpectedExec) WillDelayFor(duration time.Duration) *ExpectedExec + func (e *ExpectedExec) WillReturnError(err error) *ExpectedExec + func (e *ExpectedExec) WillReturnResult(result driver.Result) *ExpectedExec + func (e *ExpectedExec) WithArgs(args ...driver.Value) *ExpectedExec + type ExpectedPing struct + func (e *ExpectedPing) String() string + func (e *ExpectedPing) WillDelayFor(duration time.Duration) *ExpectedPing + func (e *ExpectedPing) WillReturnError(err error) *ExpectedPing + type ExpectedPrepare struct + func (e *ExpectedPrepare) ExpectExec() *ExpectedExec + func (e *ExpectedPrepare) ExpectQuery() *ExpectedQuery + func (e *ExpectedPrepare) String() string + func (e *ExpectedPrepare) WillBeClosed() *ExpectedPrepare + func (e *ExpectedPrepare) WillDelayFor(duration time.Duration) *ExpectedPrepare + func (e *ExpectedPrepare) WillReturnCloseError(err error) *ExpectedPrepare + func (e *ExpectedPrepare) WillReturnError(err error) *ExpectedPrepare + type ExpectedQuery struct + func (e *ExpectedQuery) RowsWillBeClosed() *ExpectedQuery + func (e *ExpectedQuery) String() string + func (e *ExpectedQuery) WillDelayFor(duration time.Duration) *ExpectedQuery + func (e *ExpectedQuery) WillReturnError(err error) *ExpectedQuery + func (e *ExpectedQuery) WillReturnRows(rows ...*Rows) *ExpectedQuery + func (e *ExpectedQuery) WithArgs(args ...driver.Value) *ExpectedQuery + type ExpectedRollback struct + func (e *ExpectedRollback) String() string + func (e *ExpectedRollback) WillReturnError(err error) *ExpectedRollback + 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 ...*Column) *Rows + func (r *Rows) AddRow(values ...driver.Value) *Rows + func (r *Rows) AddRows(values ...[]driver.Value) *Rows + func (r *Rows) CloseError(err error) *Rows + func (r *Rows) FromCSVString(s string) *Rows + func (r *Rows) RowError(row int, err error) *Rows + type Sqlmock interface + NewColumn func(name string) *Column + NewRowsWithColumnDefinition func(columns ...*Column) *Rows + func New(options ...func(*sqlmock) error) (*sql.DB, Sqlmock, error) + func NewWithDSN(dsn string, options ...func(*sqlmock) error) (*sql.DB, Sqlmock, error) + type SqlmockCommon interface + ExpectBegin func() *ExpectedBegin + ExpectClose func() *ExpectedClose + ExpectCommit func() *ExpectedCommit + ExpectExec func(expectedSQL string) *ExpectedExec + ExpectPing func() *ExpectedPing + ExpectPrepare func(expectedSQL string) *ExpectedPrepare + ExpectQuery func(expectedSQL string) *ExpectedQuery + ExpectRollback func() *ExpectedRollback + ExpectationsWereMet func() error + MatchExpectationsInOrder func(bool) + NewRows func(columns []string) *Rows