Versions in this module Expand all Collapse all v0 v0.9.0 Aug 18, 2026 Changes in this version + var ErrDriverAlreadyRegistered = errors.New("driver already registered") + var ErrNoRegisteredAdapter = errors.New("no registered adapter for driver") + func Register(name string, adapter Adapter) + type Adapter interface + AdaptDB func(ctx context.Context, db *gorm.DB) (*DB, error) + type DB struct + func NewDB(d driver.DBFactory, tx *gorm.DB) *DB + func Open(dialector gorm.Dialector, opts ...gorm.Option) (*DB, error) + func (db *DB) Begin(opts ...*sql.TxOptions) *DB + func (db *DB) CurrentTenant(ctx context.Context) string + func (db *DB) MigrateSharedModels(ctx context.Context) error + func (db *DB) MigrateTenantModels(ctx context.Context, tenantID string) error + func (db *DB) OffboardTenant(ctx context.Context, tenantID string) error + func (db *DB) RegisterModels(ctx context.Context, models ...driver.TenantTabler) error + func (db *DB) Session(config *gorm.Session) *DB + func (db *DB) Transaction(fc func(tx *DB) error, opts ...*sql.TxOptions) (err error) + func (db *DB) UseTenant(ctx context.Context, tenantID string) (reset func() error, err error) + func (db *DB) WithContext(ctx context.Context) *DB + func (db *DB) WithTenant(ctx context.Context, tenantID string, fc func(tx *DB) error, ...) (err error) + type TenantModel struct + DomainURL string + SchemaName string