assertdb

package
v1.52.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: AGPL-3.0, AGPL-3.0-or-later Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestQuery

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

TestQuery is a query that we can assert the result of

func Query

func Query(t *testing.T, db *sqlx.DB, sql string, args ...any) *TestQuery

Query creates a new query on which one can assert things

func (*TestQuery) Columns

func (q *TestQuery) Columns(expected map[string]any, msgAndArgs ...any)

Columns asserts that the query returns the given column values

func (*TestQuery) Returns

func (q *TestQuery) Returns(expected any, msgAndArgs ...any)

Returns asserts that the query returns a single value

Jump to

Keyboard shortcuts

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