pgsql

package
v0.9.69 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(w *Postgres)

func WithConnMaxIdleTime

func WithConnMaxIdleTime(d time.Duration) Option

func WithConnMaxLifetime

func WithConnMaxLifetime(d time.Duration) Option

func WithLogger

func WithLogger(logger *slog.Logger) Option

func WithMaxIdleConns

func WithMaxIdleConns(n int) Option

func WithMaxOpenConns

func WithMaxOpenConns(n int) Option

func WithQueryLogging

func WithQueryLogging(do bool) Option

type Postgres

type Postgres struct {
	// contains filtered or unexported fields
}

func Open

func Open(ctx context.Context, masterDSN string, slaveDSN string, opts ...Option) (*Postgres, error)

func (*Postgres) IsDuplicateKeyError

func (w *Postgres) IsDuplicateKeyError(err error) bool

func (*Postgres) IsNotFoundError

func (w *Postgres) IsNotFoundError(err error) bool

func (*Postgres) Master

func (w *Postgres) Master() *gorm.DB

func (*Postgres) Shutdown

func (w *Postgres) Shutdown(ctx context.Context) error

func (*Postgres) Slave

func (w *Postgres) Slave() *gorm.DB

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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