Documentation ¶
Overview ¶
Package mock provides a mock sql driver for tests. Register the driver with the database/sql package:
sql.Register("mock-driver-name", &mock.Driver{})
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // AnyArg represents an argument whose value might be dynamic (randomized). AnyArg = &struct{ name string }{"any argument"} )
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct { PrepareFunc func(query string) (driver.Stmt, error) BeginFunc func() (driver.Tx, error) }
Conn implements the sql/driver.Conn interface.
func NewQueryConn ¶
func NewTransactionConn ¶
type Query ¶
Query simplifies sending arguments/constraints to custom connections.
func NewAnyQuery ¶
NewAnyQuery creates a query that allows any name/args.
type Result ¶
Result implements the sql/driver.Result interface.
func (Result) LastInsertId ¶
func (Result) RowsAffected ¶
type Rows ¶
type Rows struct { ColumnsFunc func() []string CloseFunc func() error NextFunc func(dest []driver.Value) error }
Rows implements the sql/driver.Rows interface.
Click to show internal directories.
Click to hide internal directories.