database

package
v2.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2026 License: MIT Imports: 3 Imported by: 0

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

func StartSpan(ctx context.Context, dbName string, sql string) *sentry.Span

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.

Directories

Path Synopsis
Package postgres provides several github.com/jackc/pgx related helpers for interacting with postgres.
Package postgres provides several github.com/jackc/pgx related helpers for interacting with postgres.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL