Versions in this module Expand all Collapse all v1 v1.1.0 Nov 7, 2026 v1.0.0 Nov 7, 2026 Changes in this version + const DefaultTenantColumn + func InTx(ctx context.Context) bool + func Transaction(ctx context.Context, db *gorm.DB, fn func(ctx context.Context) error) error + func TxFrom(ctx context.Context, fallback *gorm.DB) *gorm.DB + func WithTx(ctx context.Context, tx *gorm.DB) context.Context + type Option func(cfg *config) + func Tenanted() Option + func WithEntityName(name string) Option + func WithSortable(cols ...string) Option + func WithTenantColumn(col string) Option + type Page struct + Items []T + Total int64 + type Repository struct + func New[T any](db *gorm.DB, opts ...Option) *Repository[T] + func (r *Repository[T]) All(ctx context.Context, scopes ...gormx.Scope) ([]T, error) + func (r *Repository[T]) Count(ctx context.Context, scopes ...gormx.Scope) (int64, error) + func (r *Repository[T]) Create(ctx context.Context, model *T) error + func (r *Repository[T]) CreateMany(ctx context.Context, models []T) error + func (r *Repository[T]) DB(ctx context.Context) *gorm.DB + func (r *Repository[T]) Delete(ctx context.Context, scopes ...gormx.Scope) (int64, error) + func (r *Repository[T]) DeleteByID(ctx context.Context, id uuid.UUID) error + func (r *Repository[T]) Exists(ctx context.Context, scopes ...gormx.Scope) (bool, error) + func (r *Repository[T]) FindByID(ctx context.Context, id uuid.UUID, scopes ...gormx.Scope) (*T, error) + func (r *Repository[T]) FindOne(ctx context.Context, scopes ...gormx.Scope) (*T, error) + func (r *Repository[T]) List(ctx context.Context, q pagination.Query, scopes ...gormx.Scope) (Page[T], error) + func (r *Repository[T]) LockByID(ctx context.Context, id uuid.UUID) (*T, error) + func (r *Repository[T]) Save(ctx context.Context, model *T) error + func (r *Repository[T]) Scoped(ctx context.Context) (*gorm.DB, error) + func (r *Repository[T]) Sortable() []string + func (r *Repository[T]) Unscoped(ctx context.Context) *gorm.DB + func (r *Repository[T]) UpdateByID(ctx context.Context, id uuid.UUID, fields map[string]any) error + func (r *Repository[T]) UpdateFields(ctx context.Context, fields map[string]any, scopes ...gormx.Scope) (int64, error) + type TxManager struct + func NewTxManager(db *gorm.DB) *TxManager + func (m *TxManager) Do(ctx context.Context, fn func(ctx context.Context) error) error