Documentation ¶
Index ¶
- Constants
- func BigintOrNull(n int64) pgtype.Int8
- func IsConstraintError(err error, constraint string) bool
- func SafeRollback(ctx context.Context, logger *slog.Logger, tx pgx.Tx, txName string)
- func SetConnStringVariables(conn string, vars url.Values) (string, error)
- func TextOrNull(s string) pgtype.Text
- func Time(t time.Time) pgtype.Timestamptz
- func TimeOrNull(t time.Time) pgtype.Timestamptz
- func WithTX(ctx context.Context, logger *slog.Logger, pool TransactionBeginner, ...) error
- type JobLock
- type JobLockState
- type TransactionBeginner
Constants ¶
View Source
const ( JobLockStateNone = "" JobLockStateHeld = "held" JobLockStateLost = "lost" JobLockStateReleased = "released" )
Variables ¶
This section is empty.
Functions ¶
func BigintOrNull ¶
func IsConstraintError ¶
IsConstraintError checks if an error was caused by a specific constraint violation.
func SafeRollback ¶
SafeRollback rolls back a transaction and logs if the rollback fails. If the transaction already has been closed it's not treated as an error.
func SetConnStringVariables ¶
SetConnStringVariables parses a connection string URI and adds the given query string variables to it.
func TextOrNull ¶
func TimeOrNull ¶
func TimeOrNull(t time.Time) pgtype.Timestamptz
Types ¶
type JobLock ¶
type JobLock struct {
// contains filtered or unexported fields
}
func NewJobLock ¶
func (*JobLock) RunWithContext ¶
type JobLockState ¶
type JobLockState string
type TransactionBeginner ¶
Click to show internal directories.
Click to hide internal directories.