repository

package
v0.0.0-...-b784633 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GORMRepository

type GORMRepository[T any] struct {
	// contains filtered or unexported fields
}

func NewGORMRepository

func NewGORMRepository[T any](db *gorm.DB) *GORMRepository[T]

func (GORMRepository[T]) Count

func (r GORMRepository[T]) Count(ctx context.Context, clause entity.Clause) (int, error)

func (GORMRepository[T]) Create

func (r GORMRepository[T]) Create(ctx context.Context, e *T) (*T, error)

func (GORMRepository[T]) Delete

func (r GORMRepository[T]) Delete(ctx context.Context, clause entity.Clause) error

func (GORMRepository[T]) Exists

func (r GORMRepository[T]) Exists(ctx context.Context, clause entity.Clause) (bool, error)

func (GORMRepository[T]) Find

func (r GORMRepository[T]) Find(ctx context.Context, clause entity.Clause, options repository.FindOptions) (*T, error)

func (GORMRepository[T]) FindMany

func (r GORMRepository[T]) FindMany(ctx context.Context, clause entity.Clause, options repository.FindManyOptions) ([]*T, error)

func (GORMRepository[T]) HandleError

func (r GORMRepository[T]) HandleError(tx *gorm.DB) error

func (GORMRepository[T]) Q

func (r GORMRepository[T]) Q(ctx context.Context) *gorm.DB

func (GORMRepository[T]) Update

func (r GORMRepository[T]) Update(ctx context.Context, e *T) error

Jump to

Keyboard shortcuts

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