postgres

package module
v0.0.0-...-f81d64f Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RetryAttempts = 4
	RetryDelay    = 500 * time.Millisecond
)

Variables

This section is empty.

Functions

func BadCli

func BadCli(t testing.TB) *pgxpool.Pool

func New

func New(connString string, log *zap.Logger) (*pgxpool.Pool, error)

New opens new postgres connection, configures it and return prepared client.

func NewTest

func NewTest(t testing.TB) (*pgxpool.Pool, func())

NewTest prepares test client.

If error occurred while creating connection then test will be skipped. Second argument cleanup function to close connection and rollback all changes.

func NewTestWithTearDown

func NewTestWithTearDown(t testing.TB) (*pgxpool.Pool, func(...string))

func NewWithFx

func NewWithFx(lc fx.Lifecycle, connString string, log *zap.Logger) (*pgxpool.Pool, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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