constructpgx

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertRowsAffected

func AssertRowsAffected(operation string, expectedRows int) func(pgconn.CommandTag) error

AssertRowsAffected returns a func that checks if the given operation result affected exactly the expected number of rows.

func CollectRows

func CollectRows[T any](rows pgx.Rows, err error) ([]T, error)

CollectRows collects all rows to the given target type from a ExecutiveQueryBuilder.Query result. It is based on pgx.CollectRows but accepts an additional error for easier use.

func ScanRow

func ScanRow[T any](row pgx.Row, err error) (T, error)

ScanRow scans a single row to the given target type from a ExecutiveQueryBuilder.QueryRow result.

Types

This section is empty.

Jump to

Keyboard shortcuts

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