postgresql

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

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

Go to latest
Published: Feb 7, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package postgresql provides a run.Config implementation to create a pgx Pool.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DSN                    string        `run:"secret,usage=data source name"`
	DSNReadOnly            string        `run:"secret,usage=read-only data source name"`
	MaxIdleConnections     int32         `run:"usage=max. idle connections"`
	MaxOpenConnections     int32         `run:"usage=max. open connections"`
	MaxConnectionsLifetime time.Duration `run:"usage=max. connection lifetime"`
	MaxConnectionsIdleTime time.Duration `run:"usage=max. connection idle time"`

	Prefix string `run:"-"`
	// contains filtered or unexported fields
}

Config implements run.Config to allow configuration of a db connection pool.

func (*Config) Init

func (c *Config) Init()

func (*Config) Name

func (c *Config) Name() string

Name implements run.Unit.

func (*Config) Pool

func (c *Config) Pool() *pgxpool.Pool

Pool returns the established database connection pool handler.

func (*Config) PreRun

func (c *Config) PreRun() error

PreRun implements run.PreRunner.

func (*Config) ReadOnlyPool

func (c *Config) ReadOnlyPool() *pgxpool.Pool

ReadOnlyPool returns the established read-only database connection pool handler. If no read-only connection pool is established, the default pool will be returned.

func (*Config) Validate

func (c *Config) Validate(cem run.ConfigErrorManager)

Validate implements run.Config.

Jump to

Keyboard shortcuts

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