gormf

package
v0.10.7 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2022 License: GPL-3.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMultipleFields = errors.New("multiple fields")
	ErrFieldNotFound  = errors.New("field not found")
)

Functions

func Closer added in v0.10.5

func Closer(db *gorm.DB) io.Closer

func CollectTaggedColumns

func CollectTaggedColumns(entity interface{}, setting string) map[string]string

CollectTaggedColumns collects all columns from this entity tagged with a setting from this entity and all its embedded structs.

func Filter added in v0.10.5

func Filter(tx *gorm.DB, entity any, setting string, operator string, value any) (*gorm.DB, error)

func LogfLogger added in v0.10.5

func LogfLogger(clock syncf.Clock, logger func() logf.Interface) logger.Interface

func OnConflictClause

func OnConflictClause(entity interface{}, setting string, updateAll bool, doUpdates clause.Set) *clause.OnConflict

OnConflictClause generates ON CONFLICT clause containing columns tagged with "setting" in the struct of "entity".

Types

type Batch added in v0.10.5

type Batch[T any] []T

func (Batch[T]) Ensure added in v0.10.5

func (b Batch[T]) Ensure(db *gorm.DB, keySetting string) error

func (Batch[T]) EnsureSince added in v0.10.5

func (b Batch[T]) EnsureSince(db *gorm.DB, since time.Time, keySetting string) error

type JSONB

type JSONB json.RawMessage

JSONB provides PostgreSQL jsonb type support for gorm.

func ToJSONB

func ToJSONB(value interface{}) (JSONB, error)

ToJSONB converts the specified value to jsonb.

func (JSONB) GormDataType

func (j JSONB) GormDataType() string

func (*JSONB) Scan

func (j *JSONB) Scan(value interface{}) error

func (JSONB) String

func (j JSONB) String() string

func (JSONB) Unmarshal

func (j JSONB) Unmarshal(value interface{}) error

func (JSONB) Value

func (j JSONB) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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