Versions in this module Expand all Collapse all v0 v0.3.0 Jul 17, 2026 Changes in this version + const DefaultMySQLSoftDeleteMarkerField + var ErrRawRequiresHost = errors.New("saas/gorm: raw SQL requires host context") + var ErrTenantFieldNotFound = errors.New("saas/gorm: tenant field not found") + var ErrTenantFieldUpdate = errors.New("saas/gorm: tenant field cannot be updated in tenant context") + var ErrTenantMismatch = saas.ErrTenantMismatch + var ErrUnscopedRequiresHost = errors.New("saas/gorm: unscoped requires host context") + func BulkCreate(ctx context.Context, db *gorm.DB, values interface{}) *gorm.DB + func HardDelete(ctx context.Context, db *gorm.DB, value interface{}, conds ...interface{}) *gorm.DB + func SafeExec(ctx context.Context, db *gorm.DB, sqlText string, values ...interface{}) *gorm.DB + func SafeRaw(ctx context.Context, db *gorm.DB, sqlText string, values ...interface{}) *gorm.DB + func TenantScope(ctx context.Context) func(*gorm.DB) *gorm.DB + type Config struct + IncludeSoftDeleted bool + SoftDeleteField string + TenantField string + type DeletePolicy int + const DeleteHard + const DeleteSoft + type MySQLSoftDeleteUniqueIndex struct + Fields []string + MarkerField string + TenantField string + func NewMySQLSoftDeleteUniqueIndex(tenantField string, businessFields []string, markerField string) (MySQLSoftDeleteUniqueIndex, error) + func (index MySQLSoftDeleteUniqueIndex) Columns() []string + type Plugin struct + func New(config Config) *Plugin + func (plugin *Plugin) Initialize(db *gorm.DB) error + func (plugin *Plugin) Name() string + type Scopes struct + func NewScopes(config Config) Scopes + func (scopes Scopes) TenantScope(ctx context.Context) func(*gorm.DB) *gorm.DB Other modules containing this package github.com/DarkInno/saas