postgres

package
v1.3.12 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(
	c PgxPoolCfg,
	opts ...option,
) (*pgxpool.Pool, error)

func WithMigrate added in v1.3.0

func WithMigrate(m *MigrateCfg) option

Types

type Extra

type Extra struct {
	MaxOpenConnections int32 `default:"10"`
	MinOpenConnections int32 `default:"1"`
}

type MigrateCfg added in v1.3.0

type MigrateCfg struct {
	MigratePath string `default:"."`
	Fs          embed.FS
	PgDSN       string
}

type PgxPoolCfg

type PgxPoolCfg struct {
	Host     string
	Port     int           `default:"5432"`
	User     string        `default:"postgres"`
	Password string        `default:"postgres"`
	Database string        `default:"postgres"`
	SSLMode  string        `default:"disable"`
	Timeout  time.Duration `default:"5s"`
	Extra    Extra
	Migrate  *MigrateCfg
}

Jump to

Keyboard shortcuts

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