preformTestUtil

package
v0.0.0-...-1e4cd2d Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestDB

func NewTestDB(driver string) *sql.DB

Types

type Row

type Row struct {
	// contains filtered or unexported fields
}

type Rows

type Rows struct {
	// contains filtered or unexported fields
}

type TestModelScanner

type TestModelScanner[B any] struct {
	ErrorQueue  []error
	CountQueue  []uint64
	AnyQueue    []any
	BodyQueue   []*B
	BodiesQueue [][]B
	RawQueue    []*preform.RowsWithCols
}

func NewTestModelScanner

func NewTestModelScanner[B any]() *TestModelScanner[B]

func (*TestModelScanner[B]) ScanAny

func (t *TestModelScanner[B]) ScanAny(rows preform.IRows, cols []preform.ICol, max uint64) ([]any, error)

func (*TestModelScanner[B]) ScanBodies

func (t *TestModelScanner[B]) ScanBodies(rows preform.IRows, cols []preform.ICol, max uint64) ([]B, error)

func (*TestModelScanner[B]) ScanBodiesFast

func (t *TestModelScanner[B]) ScanBodiesFast(rows preform.IRows, cols []preform.ICol, max uint64) ([]B, error)

func (*TestModelScanner[B]) ScanBody

func (t *TestModelScanner[B]) ScanBody(row preform.IRow, cols []preform.ICol) (*B, error)

func (*TestModelScanner[B]) ScanCount

func (t *TestModelScanner[B]) ScanCount(rows preform.IRows) (uint64, error)

func (*TestModelScanner[B]) ScanRaw

func (t *TestModelScanner[B]) ScanRaw(rows preform.IRows, colValTpl []func() (any, func(*any) any), max uint64) (*preform.RowsWithCols, error)

func (*TestModelScanner[B]) ScanStructs

func (t *TestModelScanner[B]) ScanStructs(rows preform.IRows, s any) error

func (*TestModelScanner[B]) ToAnyScanner

func (t *TestModelScanner[B]) ToAnyScanner() preform.IModelScanner[any]

type TestQueryRunner

type TestQueryRunner struct {
	ErrorQueue    []error
	LastIdQueue   []int64
	AffectedQueue []int64
	StmtQueue     []*sql.Stmt
	QueryRows     []*sql.Rows
	QueryxRows    []*sqlx.Rows
}

func NewTestQueryRunner

func NewTestQueryRunner() *TestQueryRunner

func (*TestQueryRunner) AddToQueryRows

func (t *TestQueryRunner) AddToQueryRows(value [][]driver.Value, columns ...[]string)

func (*TestQueryRunner) AddToQueryxRows

func (t *TestQueryRunner) AddToQueryxRows(value [][]driver.Value, columns ...[]string)

func (*TestQueryRunner) BaseRunner

func (t *TestQueryRunner) BaseRunner() preformShare.DbQueryRunner

func (*TestQueryRunner) Exec

func (t *TestQueryRunner) Exec(query string, args ...interface{}) (sql.Result, error)

func (*TestQueryRunner) ExecContext

func (t *TestQueryRunner) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

func (*TestQueryRunner) InsertAndReturnAutoId

func (t *TestQueryRunner) InsertAndReturnAutoId(ctx context.Context, lastIdMethod preformShare.SqlDialectLastInsertIdMethod, query string, args ...any) (int64, error)

func (*TestQueryRunner) IsTester

func (t *TestQueryRunner) IsTester()

func (*TestQueryRunner) Prepare

func (t *TestQueryRunner) Prepare(query string) (*sql.Stmt, error)

func (*TestQueryRunner) PrepareContext

func (t *TestQueryRunner) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)

func (*TestQueryRunner) Preparex

func (t *TestQueryRunner) Preparex(query string) (*sqlx.Stmt, error)

func (*TestQueryRunner) PreparexContext

func (t *TestQueryRunner) PreparexContext(ctx context.Context, query string) (*sqlx.Stmt, error)

func (*TestQueryRunner) Query

func (t *TestQueryRunner) Query(query string, args ...interface{}) (*sql.Rows, error)

func (*TestQueryRunner) QueryContext

func (t *TestQueryRunner) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)

func (*TestQueryRunner) QueryRow

func (t *TestQueryRunner) QueryRow(query string, args ...interface{}) *sql.Row

func (*TestQueryRunner) QueryRowContext

func (t *TestQueryRunner) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row

func (*TestQueryRunner) QueryRowx

func (t *TestQueryRunner) QueryRowx(query string, args ...interface{}) *sqlx.Row

func (*TestQueryRunner) QueryRowxContext

func (t *TestQueryRunner) QueryRowxContext(ctx context.Context, query string, args ...interface{}) *sqlx.Row

func (*TestQueryRunner) Queryx

func (t *TestQueryRunner) Queryx(query string, args ...interface{}) (*sqlx.Rows, error)

func (*TestQueryRunner) QueryxContext

func (t *TestQueryRunner) QueryxContext(ctx context.Context, query string, args ...interface{}) (*sqlx.Rows, error)

func (*TestQueryRunner) RelatedFactory

type TestSqlConnector

type TestSqlConnector struct {
	// contains filtered or unexported fields
}

func (TestSqlConnector) Connect

func (t TestSqlConnector) Connect(ctx context.Context) (driver.Conn, error)

func (TestSqlConnector) Driver

func (t TestSqlConnector) Driver() driver.Driver

type TestSqlConnectorDriver

type TestSqlConnectorDriver struct {
	// contains filtered or unexported fields
}

func (TestSqlConnectorDriver) Open

func (t TestSqlConnectorDriver) Open(name string) (driver.Conn, error)

func (TestSqlConnectorDriver) TestDriverName

func (t TestSqlConnectorDriver) TestDriverName() string

Jump to

Keyboard shortcuts

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