crud

package
v4.1.7 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound         = errors.New("not found")
	ErrFound            = errors.New("found")
	ErrUpdateNotApplied = errors.New("update not applied")
)

Errors returned by CRUD

Functions

This section is empty.

Types

type Basic

type Basic[A any] gorm.Backend

func (*Basic[A]) Begin

func (b *Basic[A]) Begin() *Basic[A]

func (*Basic[A]) Create

func (b *Basic[A]) Create(src *A, opts ...func(*g.DB) *g.DB) error

func (*Basic[A]) Delete

func (b *Basic[A]) Delete(conds ...interface{}) error

func (*Basic[A]) End

func (b *Basic[A]) End(rErr error) error

func (*Basic[A]) Find

func (b *Basic[A]) Find(pgn gorm.Pagination, opts ...func(*g.DB) *g.DB) ([]*A, *gorm.Pagination, error)

func (*Basic[A]) Get

func (b *Basic[A]) Get(conds ...interface{}) (*A, error)

func (*Basic[A]) Update

func (b *Basic[A]) Update(upd A, opts ...func(*g.DB) *g.DB) error

Jump to

Keyboard shortcuts

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