persist

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: BSD-3-Clause Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v1.12.0

type Config struct {
	FetchRelated  bool
	StoreRelated  bool
	DeleteRelated bool
	Params        map[string]interface{}
}

func (Config) Param added in v1.12.0

func (c Config) Param(n string) (interface{}, bool)

func (Config) WithOptions added in v1.12.0

func (c Config) WithOptions(opts []Option) Config

type DeleteReferencesPersister

type DeleteReferencesPersister interface {
	DeleteReferences(Persister, interface{}) error
}

type DeleteRelatedPersister

type DeleteRelatedPersister interface {
	DeleteRelated(Persister, interface{}) error
}

type FetchRelatedPersister

type FetchRelatedPersister interface {
	FetchRelated(Persister, interface{}) error
}

type Option added in v1.12.0

type Option func(Config) Config

func Cascade added in v1.12.0

func Cascade(on bool) Option

func DeleteRelated added in v1.12.0

func DeleteRelated(on bool) Option

func FetchRelated added in v1.12.0

func FetchRelated(on bool) Option

func Params added in v1.12.0

func Params(p map[string]interface{}) Option

func StoreRelated added in v1.12.0

func StoreRelated(on bool) Option

func UseConfig added in v1.12.0

func UseConfig(c Config) Option

type Persister

type Persister interface {
	dbx.Context
	WithContext(dbx.Context) Persister
	WithOptions(...Option) Persister
	Config() Config
	Param(name string) interface{}
	Store(string, interface{}, []string) error
	Fetch(string, interface{}, interface{}) error
	Count(string, ...interface{}) (int, error)
	Select(interface{}, string, ...interface{}) error
	Delete(string, interface{}) error
	DeleteWithID(string, reflect.Type, interface{}) error
}

func New

func New(cxt dbx.Context, fm *entity.FieldMapper, reg *registry.Registry, ids ident.Generator, opts ...Option) Persister

type Row added in v1.1.0

type Row struct {
	*sqlx.Row
	// contains filtered or unexported fields
}

func (*Row) ScanStruct added in v1.1.0

func (r *Row) ScanStruct(dest interface{}) error

type Rows added in v1.1.0

type Rows struct {
	*sqlx.Rows
	// contains filtered or unexported fields
}

func (*Rows) ScanStruct added in v1.1.0

func (r *Rows) ScanStruct(dest interface{}) error

type StoreReferencesPersister

type StoreReferencesPersister interface {
	StoreReferences(Persister, interface{}) error
}

type StoreRelatedPersister

type StoreRelatedPersister interface {
	StoreRelated(Persister, interface{}) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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