internal

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractPreloader added in v0.18.2

func ExtractPreloader[PL any, Q any](queryMods ...bob.Mod[Q]) ([]bob.Mod[Q], []PL)

func FilterNonZero added in v0.15.0

func FilterNonZero[T comparable](s []T) []T

func FirstNonEmpty added in v0.15.0

func FirstNonEmpty[T comparable, Ts ~[]T](slice Ts) T

func GetColumnValues added in v0.3.1

func GetColumnValues[T any](mapping Mapping, filter []string, objs ...T) ([]string, [][]bob.Expression, error)

Get the values for non generated columns

func ToAnySlice added in v0.15.0

func ToAnySlice[T any, Ts ~[]T](slice Ts) []any

Types

type AfterPreloader added in v0.13.0

type AfterPreloader struct {
	// contains filtered or unexported fields
}

AfterPreloader is embedded in a Preloader to chain loading whenever a preloaded object is scanned, it should be collected with the Collect method The loading functions should be added with AppendLoader later, when this object is called like any other bob.Loader, it calls the appended loaders with the collected objects

func NewAfterPreloader added in v0.13.0

func NewAfterPreloader[T any, Ts ~[]T]() *AfterPreloader

NewAfterPreloader returns a new AfterPreloader based on the given types

func (*AfterPreloader) AppendLoader added in v0.13.0

func (a *AfterPreloader) AppendLoader(fs ...bob.Loader)

func (*AfterPreloader) Collect added in v0.13.0

func (a *AfterPreloader) Collect(v any) error

func (*AfterPreloader) Load added in v0.13.0

func (a *AfterPreloader) Load(ctx context.Context, exec bob.Executor, _ any) error

type Mapping added in v0.3.1

type Mapping struct {
	All           []string
	PKs           []string
	NonPKs        []string
	Generated     []string
	NonGenerated  []string
	AutoIncrement []string
}

func GetMappings added in v0.3.1

func GetMappings(typ reflect.Type) Mapping

func (Mapping) Columns added in v0.3.1

func (c Mapping) Columns(table ...string) orm.Columns

Jump to

Keyboard shortcuts

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