Versions in this module Expand all Collapse all v1 v1.0.0 Sep 3, 2026 Changes in this version + var ErrNoSystemToken = errors.New("db: system token was not minted by the kernel") + var ErrNoTenant = errors.New("db: no tenant in context") + var ErrScopeMismatch = errors.New("db: transaction scope mismatch") + var ErrScopeTampered = errors.New("db: the transaction's tenancy settings were rewritten inside it") + func Detached(ctx context.Context) context.Context + func Migrate(ctx context.Context, migrateURL string, fsys fs.FS) error + func Now() time.Time + func Run(ctx context.Context, c *Conn, ...) error + func RunSystem(ctx context.Context, c *Conn, tok tenancy.SystemToken, ...) error + func TenantOf(tx Tx[Tenant]) tenancy.Tenant + func TryLock(ctx context.Context, c *Conn, name string) (unlock func(), ok bool, err error) + type Conn struct + func Open(ctx context.Context, url string) (*Conn, error) + func (c *Conn) Close() error + type Pending struct + func Lazy(ctx context.Context, c *Conn, tok tenancy.SystemToken) (context.Context, *Pending, error) + func (p *Pending) Close(keep bool) error + func (p *Pending) Err() error + func (p *Pending) Tx(ctx context.Context) (Tx[Tenant], error) + type Scope interface + type System struct + type Tenant struct + type Tx struct + func (t Tx[S]) DB() *gorm.DB