postgres

package
v0.0.0-...-79c0a86 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionConfig

type ConnectionConfig struct {
	// contains filtered or unexported fields
}

func NewConnectionConfig

func NewConnectionConfig(host, port, dbname, username, password, sslmode string) ConnectionConfig

type Option

type Option func(*poolConfig)

func ConnAttempts

func ConnAttempts(connAttempts int) Option

func ConnTimeout

func ConnTimeout(connTimeout time.Duration) Option

func MaxPoolSize

func MaxPoolSize(maxPoolSize int) Option

type Postgres

type Postgres struct {
	Builder sq.StatementBuilderType
	Pool    *pgxpool.Pool
}

func New

func New(ctx context.Context, connectionConfig ConnectionConfig, opts ...Option) (*Postgres, error)

func (*Postgres) Close

func (p *Postgres) Close()

Jump to

Keyboard shortcuts

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