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 ¶
- type CRUD
- func (r *CRUD[T, I]) Create(ctx context.Context, e *T) (sql.Result, error)
- func (r *CRUD[T, I]) Delete(ctx context.Context, id I) (sql.Result, error)
- func (r *CRUD[T, I]) DeleteAll(ctx context.Context) (sql.Result, error)
- func (r *CRUD[T, I]) GetAll(ctx context.Context, dest *[]T) error
- func (r *CRUD[T, I]) GetByID(ctx context.Context, dest *T, id I) error
- func (r *CRUD[T, I]) GetByIDs(ctx context.Context, dest *[]T, ids []I) error
- func (r *CRUD[T, I]) Update(ctx context.Context, id I, e *T) (sql.Result, error)
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]
Click to show internal directories.
Click to hide internal directories.