pgx

package module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 10 Imported by: 4 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

pgx

A module to work with PostgreSQL using PGX package in the Modulus Framework based applications.

It is also a part of Mtools. If you want to create modules with access to PostgreSQL, and code generation from SQL queries using SQLc, you should unstall this module into your project.

Moreover, this package provides a set of tools to work with migrations to PostgreSQL. The migrator package is implemented as a separate module that can be installed inside your project. Migration module is a set of CLI commands to run appropriate actions from DbMate.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewManifesto

func NewManifesto() module.Manifesto

func NewModule

func NewModule() *module.Module

func NewPgxPool

func NewPgxPool(
	logger *slog.Logger,
	config ModuleConfig,
) (*pgxpool.Pool, error)

Types

type ConnectionConfig

type ConnectionConfig struct {
	Host     string `env:"HOST, default=localhost"`
	Port     int    `env:"PORT, default=5432"`
	User     string `env:"USER, default=postgres"`
	Password string `env:"PASSWORD, default=foobar"`
	Database string `env:"DB_NAME, default=test"`
	SslMode  string `env:"SSL_MODE, default=disable"`
}

func (ConnectionConfig) Dsn

func (c ConnectionConfig) Dsn() string

type ModuleConfig

type ModuleConfig struct {
	DSN string `` /* 200-byte string literal not displayed */

	ConnectionConfig *ConnectionConfig `env:",prefix=PG_"`
}

func (ModuleConfig) DBName added in v0.2.1

func (c ModuleConfig) DBName() string

func (ModuleConfig) Dsn

func (c ModuleConfig) Dsn() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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