generics

package
v0.19.770 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

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