pqx

package module
Version: v0.0.0-...-b72a6fb Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultVersion = "14.2.0"

Variables

This section is empty.

Functions

This section is empty.

Types

type Postgres

type Postgres struct {
	Version string // for a list of versions by OS, see: https://mvnrepository.com/artifact/io.zonky.test.postgres
	Dir     string
	Port    int // The port to bind postgres too. If the value is zero, a random port is assigned.

	DebugLevel int // passed to postgres using the ("-d") flag
	// contains filtered or unexported fields
}

func (*Postgres) CreateDB

func (p *Postgres) CreateDB(ctx context.Context, logf func(string, ...any), name, schema string) (db *sql.DB, dsn string, cleanup func(), err error)

Open creates a database for the schema, connects to it, and returns the *sql.DB. .. more words needed here.

func (*Postgres) DSN

func (p *Postgres) DSN(dbname string) string

func (*Postgres) Flush

func (p *Postgres) Flush()

func (*Postgres) Shutdown

func (p *Postgres) Shutdown() error

func (*Postgres) Start

func (p *Postgres) Start(ctx context.Context, logf func(string, ...any)) error

ctx only affects initdb and pingUntilUp; otherwise, the context is ignored.

Source Files

Directories

Path Synopsis
Package pqxtest provides functions for testing with an embedded live, lightweight, standalone Postgres instance optimized for fast setup/teardown and cleanup.
Package pqxtest provides functions for testing with an embedded live, lightweight, standalone Postgres instance optimized for fast setup/teardown and cleanup.
internal
backoff
Package backoff provides a back-off timer type.
Package backoff provides a back-off timer type.

Jump to

Keyboard shortcuts

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