postgres

package
v0.0.0-...-91db431 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PgConfig

type PgConfig struct {
	User       string
	Password   string
	Host       string
	Port       int
	Name       string
	DisableTLS bool
}

type PgDb

type PgDb struct {
	Url url.URL
	// contains filtered or unexported fields
}

func NewPgDb

func NewPgDb(logger *zap.Logger, cfg PgConfig) (*PgDb, func() error, error)

Get New Postgres Database

func (*PgDb) GetConn

func (db *PgDb) GetConn(ctx context.Context) (*sqlx.Conn, func() error, error)

Get Conection, with a cancel func

func (*PgDb) RunInTx

func (db *PgDb) RunInTx(ctx context.Context, fn TxFunction) error

type TxFunction

type TxFunction func(tx *sqlx.Tx) error

Jump to

Keyboard shortcuts

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