Documentation
¶
Overview ¶
Package database provides database agnostic helpers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrResourceNotFound is an error with value "resource not found". ErrResourceNotFound = errors.New("resource not found") // ErrResourceConflict is an error with value "resource unique value already used". ErrResourceConflict = errors.New("resource conflicts with existing resource") )
Functions ¶
func StartSpan ¶
StartSpan is used to start a sentry.Span.
func WrapWithSpan ¶
func WrapWithSpan[T any]( ctx context.Context, dbName string, queryFunc func(ctx context.Context, sql string, args ...any) (T, error), sql string, args ...any) (T, error)
WrapWithSpan is used to wrap a database action in a sentry.Span.
func WrapWithSpanNoError ¶
func WrapWithSpanNoError[T any]( ctx context.Context, dbName string, queryFunc func(ctx context.Context, sql string, args ...any) T, sql string, args ...any) T
WrapWithSpanNoError is used to wrap a database action in a sentry.Span. The executed database action shouldn't return an error.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.