bob

package module
v0.21.2 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: MIT Imports: 6 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SoftDeletes = &selects.Scope{
	Name: "soft-deletes",
	Apply: func(b *selects.SubBuilder) *selects.SubBuilder {
		return b.Where(b.GetTable()+".deleted_at", "=", nil)
	},
}

Functions

func From

func From[T models.Model]() *selects.Builder[T]

func InitializeRelationships added in v0.11.4

func InitializeRelationships(v any) error

func InsertMany added in v0.21.0

func InsertMany[T models.Model](tx builder.QueryExecer, models []T) error

func InsertManyContext added in v0.21.0

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

func Load added in v0.11.4

func Load(tx *sqlx.Tx, v any, relation string) error

func New

func New[T models.Model]() *selects.Builder[T]

func NewEmpty

func NewEmpty[T models.Model]() *selects.Builder[T]

func Save

func Save(tx builder.QueryExecer, v models.Model) error

func SaveContext

func SaveContext(ctx context.Context, tx builder.QueryExecer, v models.Model) error

Types

type BaseModel

type BaseModel = models.BaseModel

type Model

type Model = models.Model

type Scope added in v0.9.1

type Scope = selects.Scope

type ScopeFunc added in v0.9.1

type ScopeFunc = selects.ScopeFunc

type Scoper added in v0.9.1

type Scoper = selects.Scoper

Jump to

Keyboard shortcuts

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