crud

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package crud provides the core CRUD operations implementation for sqlcredo. It implements generic Create, Read, Update, and Delete operations using goqu for query building, supporting multiple SQL dialects and prepared statements.

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