model

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 9 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsertMany

func InsertMany[T Model](tx database.DB, models []T) error

func InsertManyContext

func InsertManyContext[T Model](ctx context.Context, tx database.DB, models []T) error

func Save

func Save(tx database.DB, v Model) error

func SaveContext

func SaveContext(ctx context.Context, tx database.DB, v Model) error

Types

type BaseModel

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

func (*BaseModel) AfterLoad

func (m *BaseModel) AfterLoad(ctx context.Context, tx database.DB) error

func (*BaseModel) AfterSave

func (m *BaseModel) AfterSave(ctx context.Context, tx database.DB) error

func (*BaseModel) Context

func (m *BaseModel) Context() context.Context

func (*BaseModel) InDatabase

func (m *BaseModel) InDatabase() bool

type Contexter

type Contexter interface {
	Context() context.Context
}

type Model

type Model interface {
	InDatabase() bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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