package
0.0.0-20240907224255-7a2aee42f019
Repository: https://github.com/npushpakumara/go-backend-template.git
Documentation: pkg.go.dev

# Functions

FromContext retrieves the *gorm.DB instance (database connection) from the context.
IsPgxError checks if the given error is a PostgreSQL error and returns a corresponding custom error.
NewDatabase creates and configures a new database connection using GORM.
NewLogger creates and returns a new Logger instance for GORM.
NewTransactionManager creates a new instance of transactionManagerImpl.
WithDB adds a *gorm.DB instance (database connection) to the given context.

# Variables

Predefined error variables for specific PostgreSQL error codes.
Predefined error variables for specific PostgreSQL error codes.
Predefined error variables for specific PostgreSQL error codes.
Predefined error variables for specific PostgreSQL error codes.

# Structs

Logger is a custom logger that implements GORM's logging interface.

# Interfaces

TransactionManager defines an interface for managing database transactions.