assertdb

package
v1.53.2 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 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) bool

Columns asserts that the query returns the given column values

func (*TestQuery) Returns

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

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