postgres
go
import "github.com/prescriptoo/prescriptoo-api/pkg/infrastructure/postgres"Package postgres provides PostgreSQL client driver initialization and connection pooling.
Index
func NewPostgresDB
go
func NewPostgresDB(ctx context.Context, cfg Config) (*sql.DB, error)NewPostgresDB initializes and verifies a PostgreSQL connection pool.
type Config
Config defines connection parameters for PostgreSQL.
go
type Config struct {
Host string
Port string
User string
Password string
DBName string
SSLMode string
MaxOpenConns int
MaxIdleConns int
ConnMaxLifetime time.Duration
}Generated by gomarkdoc