mockdb

package
v1.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	mock.Mock
}

func (*Conn) Begin

func (this *Conn) Begin() (driver.Tx, error)

func (*Conn) BeginTx

func (this *Conn) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error)

func (*Conn) Close

func (this *Conn) Close() error

func (*Conn) Prepare

func (this *Conn) Prepare(query string) (driver.Stmt, error)

type Driver

type Driver struct {
	mock.Mock
}

func (*Driver) Open

func (this *Driver) Open(name string) (driver.Conn, error)

type Result

type Result struct {
	mock.Mock
}

func (*Result) LastInsertId

func (this *Result) LastInsertId() (int64, error)

func (*Result) RowsAffected

func (this *Result) RowsAffected() (int64, error)

type Rows

type Rows struct {
	mock.Mock
}

func (*Rows) Close

func (this *Rows) Close() error

Close closes the rows iterator.

func (*Rows) Columns

func (this *Rows) Columns() []string

Columns returns the names of the columns. The number of columns of the result is inferred from the length of the slice. If a particular column name isn't known, an empty string should be returned for that entry.

func (*Rows) Next

func (this *Rows) Next(dest []driver.Value) error

Next is called to populate the next row of data into the provided slice. The provided slice will be the same size as the Columns() are wide.

Next should return io.EOF when there are no more rows.

The dest should not be written to outside of Next. Care should be taken when closing Rows not to modify a buffer held in dest.

type Stmt

type Stmt struct {
	mock.Mock
}

func (*Stmt) Close

func (this *Stmt) Close() error

func (*Stmt) Exec deprecated

func (this *Stmt) Exec(args []driver.Value) (driver.Result, error)

Exec executes a query that doesn't return rows, such as an INSERT or UPDATE.

Deprecated: Drivers should implement StmtExecContext instead (or additionally).

func (*Stmt) NumInput

func (this *Stmt) NumInput() int

NumInput returns the number of placeholder parameters.

If NumInput returns >= 0, the sql package will sanity check argument counts from callers and return errors to the caller before the statement's Exec or Query methods are called.

NumInput may also return -1, if the driver doesn't know its number of placeholders. In that case, the sql package will not sanity check Exec or Query argument counts.

func (*Stmt) Query deprecated

func (this *Stmt) Query(args []driver.Value) (driver.Rows, error)

Query executes a query that may return rows, such as a SELECT.

Deprecated: Drivers should implement StmtQueryContext instead (or additionally).

type Tx

type Tx struct {
	mock.Mock
}

func (*Tx) Commit

func (this *Tx) Commit() error

func (*Tx) Rollback

func (this *Tx) Rollback() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL