Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareSQL ¶
Compare if two SQL statements are semantically equal
Types ¶
type ExpectedQuery ¶
type ExpectedQuery struct { CallCount int // contains filtered or unexported fields }
ExpectedQuery represents an expected query
func (*ExpectedQuery) WillReturnError ¶
func (eq *ExpectedQuery) WillReturnError(columns []string, err error) *ExpectedQuery
WillReturnError sets the error to be returned for the query
func (*ExpectedQuery) WillReturnRows ¶
func (eq *ExpectedQuery) WillReturnRows(columns []string, rows [][]driver.Value) *ExpectedQuery
WillReturnRows sets the rows to be returned for the query
func (*ExpectedQuery) WithArgs ¶
func (eq *ExpectedQuery) WithArgs(args ...driver.Value) *ExpectedQuery
type MockConn ¶
type MockConn struct {
// contains filtered or unexported fields
}
MockConn implements the driver.Conn interface
type MockConnector ¶
type MockConnector struct {
// contains filtered or unexported fields
}
MockConnector implements the driver.Connector interface
func (*MockConnector) Driver ¶
func (mc *MockConnector) Driver() driver.Driver
type MockDB ¶
type MockDB struct {
// contains filtered or unexported fields
}
MockDB simulates a database connection
func (*MockDB) ExpectQuery ¶
func (m *MockDB) ExpectQuery(query string, args ...driver.Value) *ExpectedQuery
ExpectQuery expects a specific query
type MockDriver ¶
type MockDriver struct {
// contains filtered or unexported fields
}
MockDriver implements the driver.Driver interface
type MockResult ¶
type MockResult struct{}
MockResult implements the driver.Result interface
func (*MockResult) LastInsertId ¶
func (mr *MockResult) LastInsertId() (int64, error)
func (*MockResult) RowsAffected ¶
func (mr *MockResult) RowsAffected() (int64, error)
type MockRows ¶
type MockRows struct {
// contains filtered or unexported fields
}
MockRows implements the driver.Rows interface
Click to show internal directories.
Click to hide internal directories.