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.
Click to show internal directories.
Click to hide internal directories.