generics

package
v0.19.821 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchProcessing

func BatchProcessing[T any](ctx context.Context, batchSize int, query *gorm.DB, processBatch func([]*T) error) error

func IsGormErrRecordNotFound

func IsGormErrRecordNotFound(err error) bool

func TemporalDoNotRetry

func TemporalDoNotRetry(err error, args ...string) error

func TemporalGormError

func TemporalGormError(err error, args ...string) error

func ToHstore

func ToHstore(val map[string]string) pgtype.Hstore

func ToJSON

func ToJSON(val string) []byte

func ToPtrStringMap

func ToPtrStringMap(val map[string]string) map[string]*string

func ToStringMap

func ToStringMap(val pgtype.Hstore) map[string]string

func ToStringMapAny

func ToStringMapAny(val pgtype.Hstore) map[string]any

Types

type JSONBQuerier

type JSONBQuerier struct {
	*gorm.DB
}

JSONBQuerier helps build JSONB queries

func NewJSONBQuery

func NewJSONBQuery(db *gorm.DB) *JSONBQuerier

NewJSONBQuery creates a new JSONB query helper

func (*JSONBQuerier) WhereJSON

func (jq *JSONBQuerier) WhereJSON(queryArgs JSONBQuery) *gorm.DB

WhereJSON adds a WHERE condition for JSONB field

func (*JSONBQuerier) WhereJSONPath

func (jq *JSONBQuerier) WhereJSONPath(field string, path []string, operator string, value interface{}) *gorm.DB

WhereJSONPath queries nested JSON paths

type JSONBQuery

type JSONBQuery struct {
	Operator string
	Field    string
	Path     string
	Value    any
}

Jump to

Keyboard shortcuts

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