crud

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CRUD

type CRUD[T any, I comparable] struct {
	// contains filtered or unexported fields
}

func NewCRUD

func NewCRUD[T any, I comparable](table table.Info,
	executor domain.SQLExecutor, driver string,
) *CRUD[T, I]

func (*CRUD[T, I]) Create

func (r *CRUD[T, I]) Create(ctx context.Context, e *T) (sql.Result, error)

func (*CRUD[T, I]) Delete

func (r *CRUD[T, I]) Delete(ctx context.Context, id I) (sql.Result, error)

func (*CRUD[T, I]) DeleteAll

func (r *CRUD[T, I]) DeleteAll(ctx context.Context) (sql.Result, error)

func (*CRUD[T, I]) GetAll

func (r *CRUD[T, I]) GetAll(ctx context.Context, dest *[]T) error

func (*CRUD[T, I]) GetByID

func (r *CRUD[T, I]) GetByID(ctx context.Context, dest *T, id I) error

func (*CRUD[T, I]) GetByIDs

func (r *CRUD[T, I]) GetByIDs(ctx context.Context, dest *[]T, ids []I) error

func (*CRUD[T, I]) Update

func (r *CRUD[T, I]) Update(ctx context.Context, id I, e *T) (sql.Result, error)

Jump to

Keyboard shortcuts

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