Documentation
¶
Overview ¶
Package postgres provides a wrapper to connect to PostgreSQL. It also implements Unit of Work interface. See uow package for more info about Unit of Work.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is a sentinel error for not found error. ErrNotFound = pgx.ErrNoRows // ErrUniqueViolation is a sentinel error for unique violation error. ErrUniqueViolation = &pgconn.PgError{Code: postgresUniqueViolationCode} )
Functions ¶
func IsUniqueViolationError ¶
IsUniqueViolationError checks if the error is a unique violation error.
Types ¶
type Config ¶
type Config struct {
Host string `env:"POSTGRES_HOST,default=localhost"`
User string `env:"POSTGRES_USER,required"`
Password string `env:"POSTGRES_PASSWORD,required"`
Name string `env:"POSTGRES_NAME,required"`
SSLMode string `env:"POSTGRES_SSL_MODE,default=disable"`
Port int `env:"POSTGRES_PORT,default=5432"`
}
Config holds configuration for PostgreSQL.
type TxDB ¶
type TxDB struct {
// contains filtered or unexported fields
}
TxDB is a transaction version of DB interface generated by sqlc.
Click to show internal directories.
Click to hide internal directories.