postgres

package
v0.0.0-...-32396ae Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresDB

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

PostgresDB represents a PostgreSQL database connection.

func New

func New(cfg *configs.ConfigDB) (*PostgresDB, error)

New creates a new PostgreSQL database connection using the provided config.

func (*PostgresDB) Close

func (p *PostgresDB) Close() error

Close closes the PostgreSQL database connection.

func (*PostgresDB) Transaction

func (p *PostgresDB) Transaction(fn func(tx *sqlx.Tx) error) error

Transaction starts a new transaction, executes the provided function, and commits or rolls back.

Jump to

Keyboard shortcuts

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