postgresx

package
v3.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureTimezone added in v3.3.0

func ConfigureTimezone(conf *pgx.ConnConfig) []stdlib.OptionOpenDB

ConfigureTimezone returns stdlib.OptionOpenDB options that configure the connection to use the timezone specified in conf.RuntimeParams["timezone"]. This ensures that timestamp values are correctly converted to the specified timezone when scanning. The timezone is automatically populated by pgx.ParseConfig when parsing DSN.

func New

func New(conf postgres.Config) gorm.Dialector

New creates a new enhanced PostgreSQL dialector using a postgres.Config. This is a drop-in replacement for postgres.New() that provides enhanced error handling.

func Open

func Open(dsn string) gorm.Dialector

Open creates a new enhanced PostgreSQL dialector using a DSN string. This is a drop-in replacement for postgres.Open() that provides enhanced error handling.

Types

type Dialector

type Dialector struct {
	*postgres.Dialector
}

Dialector is an enhanced PostgreSQL dialector that preserves original error details alongside GORM error translations. It embeds the standard PostgreSQL dialector, inheriting all its capabilities while adding enhanced error handling.

func (*Dialector) Translate

func (d *Dialector) Translate(cause error) error

Jump to

Keyboard shortcuts

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