Documentation ¶
Index ¶
- type GORMRepository
- func (r GORMRepository[T]) Count(ctx context.Context, clause entity.Clause) (int, error)
- func (r GORMRepository[T]) Create(ctx context.Context, e *T) (*T, error)
- func (r GORMRepository[T]) Delete(ctx context.Context, clause entity.Clause) error
- func (r GORMRepository[T]) Exists(ctx context.Context, clause entity.Clause) (bool, error)
- func (r GORMRepository[T]) Find(ctx context.Context, clause entity.Clause, options repository.FindOptions) (*T, error)
- func (r GORMRepository[T]) FindMany(ctx context.Context, clause entity.Clause, options repository.FindManyOptions) ([]*T, error)
- func (r GORMRepository[T]) HandleError(tx *gorm.DB) error
- func (r GORMRepository[T]) Q(ctx context.Context) *gorm.DB
- func (r GORMRepository[T]) Update(ctx context.Context, e *T) error
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]) Create ¶
func (r GORMRepository[T]) Create(ctx context.Context, e *T) (*T, 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
Click to show internal directories.
Click to hide internal directories.