pg

package
v2.280.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package pg provides SQL database wiring and helpers for go-service.

Index

Constants

This section is empty.

Variables

Module provides the Fx module that wires PostgreSQL SQL database support.

Functions

func Open

func Open(lc di.Lifecycle, fs *os.FS, cfg *Config) (*mssqlx.DBs, error)

Open opens PostgreSQL master/slave connection pools.

If cfg is disabled, it returns (nil, nil).

func Register

func Register()

Register registers the pgx `database/sql` driver under the name "pg" and enables OpenTelemetry driver instrumentation.

Types

type Config

type Config struct {
	*config.Config `yaml:",inline" json:",inline" toml:",inline"`
}

Config contains PostgreSQL SQL database configuration.

It embeds `database/sql/config`.Config to reuse common pool settings and DSN configuration.

func (*Config) IsEnabled added in v2.115.0

func (c *Config) IsEnabled() bool

IsEnabled reports whether PostgreSQL configuration is present and enabled.

Jump to

Keyboard shortcuts

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