postgres

package
v0.0.0-...-52092a1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendRowsNonNil

func AppendRowsNonNil[T comparable, S ~[]T](slice S, rows pgx.Rows, fn pgx.RowToFunc[T]) (S, error)

AppendRowsNonNil iterates through rows, calling fn for each row, and appending the results into a slice of T if the result is not nil.

This function closes the rows automatically on return.

func CollectRowsNonNil

func CollectRowsNonNil[T comparable](rows pgx.Rows, fn pgx.RowToFunc[T]) ([]T, error)

CollectRowsNonNil iterates through rows, calling fn for each row, and collecting the results into a slice of T if the result is not nil.

This function closes the rows automatically on return.

func GetTestLogger

func GetTestLogger() *slog.Logger

Types

type DbCleanup

type DbCleanup func()

func GetTestPool

func GetTestPool() (*pgxpool.Pool, DbCleanup)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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