Documentation ¶
Index ¶
- func NewDriver(name string, dbdata Data, converters []sqlutil.Converter, opts DriverOpts) (TestDS, *SqlHandler)
- type Column
- type Data
- type DriverOpts
- type SqlHandler
- func (s SqlHandler) Close() error
- func (s SqlHandler) ColumnTypeDatabaseTypeName(index int) string
- func (s SqlHandler) ColumnTypeScanType(index int) reflect.Type
- func (s *SqlHandler) Columns() []string
- func (s *SqlHandler) Next(dest []driver.Value) error
- func (s *SqlHandler) Ping(ctx context.Context) error
- func (s *SqlHandler) Query(args []driver.Value) (driver.Rows, error)
- type State
- type TestDS
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDriver ¶
func NewDriver(name string, dbdata Data, converters []sqlutil.Converter, opts DriverOpts) (TestDS, *SqlHandler)
NewDriver creates and registers a new test datasource driver
Types ¶
type DriverOpts ¶
type DriverOpts struct { ConnectDelay int QueryDelay int ConnectError error QueryError error QueryFailTimes int }
DriverOpts the optional settings
type SqlHandler ¶
type SqlHandler struct { mock.DBHandler Data Data Opts DriverOpts State State // contains filtered or unexported fields }
SqlHandler handles driver functions
func NewDriverHandler ¶
func NewDriverHandler(data Data, opts DriverOpts) SqlHandler
NewDriverHandler creates a new driver handler
func (SqlHandler) Close ¶
func (s SqlHandler) Close() error
Close implements the database Close interface
func (SqlHandler) ColumnTypeDatabaseTypeName ¶
func (s SqlHandler) ColumnTypeDatabaseTypeName(index int) string
ColumnTypeDatabaseTypeName returns the database type for the column
func (SqlHandler) ColumnTypeScanType ¶
func (s SqlHandler) ColumnTypeScanType(index int) reflect.Type
ColumnTypeScanType returns the scan type for the column
func (*SqlHandler) Columns ¶
func (s *SqlHandler) Columns() []string
Columns represents columns from a query
func (*SqlHandler) Next ¶
func (s *SqlHandler) Next(dest []driver.Value) error
Next iterates over rows
Click to show internal directories.
Click to hide internal directories.