Versions in this module Expand all Collapse all v0 v0.9.0 Aug 18, 2026 Changes in this version + const PublicSchemaEnvVar + var ErrInvalidMigration = errors.New(...) + var ErrInvalidSharedTableName = errors.New("invalid table name for model labeled as public table") + var ErrInvalidTenantTableName = errors.New("invalid table name for model labeled as tenant table") + func ModelsToInterfaces(models []TenantTabler) []any + func PublicSchemaName() string + type DBFactory interface + CurrentTenant func(ctx context.Context, db *gorm.DB) string + MigrateSharedModels func(ctx context.Context, db *gorm.DB) error + MigrateTenantModels func(ctx context.Context, db *gorm.DB, tenantID string) error + OffboardTenant func(ctx context.Context, db *gorm.DB, tenantID string) error + RegisterModels func(ctx context.Context, db *gorm.DB, models ...TenantTabler) error + UseTenant func(ctx context.Context, db *gorm.DB, tenantID string) (reset func() error, err error) + type ModelRegistry struct + SharedModels []TenantTabler + TenantModels []TenantTabler + func NewModelRegistry(models ...TenantTabler) (*ModelRegistry, error) + type TenantTabler interface + IsSharedModel func() bool