gorm

package
v0.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 9 Imported by: 23

README

gorm adapter

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientProvider

type ClientProvider saas.ClientProvider[*gorm.DB]

type ClientProviderFunc

type ClientProviderFunc saas.ClientProviderFunc[*gorm.DB]

func (ClientProviderFunc) Get

func (c ClientProviderFunc) Get(ctx context.Context, dsn string) (*gorm.DB, error)

type DbProvider

type DbProvider saas.DbProvider[*gorm.DB]

func NewDbProvider

func NewDbProvider(cs data.ConnStrResolver, cp ClientProvider) DbProvider

type DbWrap

type DbWrap struct {
	*gorm.DB
}

func NewDbWrap

func NewDbWrap(db *gorm.DB) *DbWrap

NewDbWrap wrap gorm.DB into io.Close

func (*DbWrap) Close

func (d *DbWrap) Close() error

type HasTenant

type HasTenant sql.NullString

func NewTenantId

func NewTenantId(s string) HasTenant

func (HasTenant) DeleteClauses added in v0.6.1

func (HasTenant) DeleteClauses(f *schema.Field) []clause.Interface

func (HasTenant) GormValue

func (t HasTenant) GormValue(ctx context.Context, db *gorm.DB) (expr clause.Expr)

func (HasTenant) MarshalJSON

func (t HasTenant) MarshalJSON() ([]byte, error)

func (HasTenant) QueryClauses

func (HasTenant) QueryClauses(f *schema.Field) []clause.Interface

func (*HasTenant) Scan

func (t *HasTenant) Scan(value interface{}) error

Scan implements the Scanner interface.

func (HasTenant) UnmarshalJSON

func (t HasTenant) UnmarshalJSON(b []byte) error

func (HasTenant) UpdateClauses added in v0.6.1

func (HasTenant) UpdateClauses(f *schema.Field) []clause.Interface

func (HasTenant) Value

func (t HasTenant) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type HasTenantDeleteClause added in v0.6.1

type HasTenantDeleteClause struct {
	Field *schema.Field
}

func (HasTenantDeleteClause) Build added in v0.6.1

func (HasTenantDeleteClause) MergeClause added in v0.6.1

func (sd HasTenantDeleteClause) MergeClause(*clause.Clause)

func (HasTenantDeleteClause) ModifyStatement added in v0.6.1

func (sd HasTenantDeleteClause) ModifyStatement(stmt *gorm.Statement)

func (HasTenantDeleteClause) Name added in v0.6.1

func (sd HasTenantDeleteClause) Name() string

type HasTenantQueryClause

type HasTenantQueryClause struct {
	Field *schema.Field
}

func (HasTenantQueryClause) Build

func (HasTenantQueryClause) MergeClause

func (sd HasTenantQueryClause) MergeClause(*clause.Clause)

func (HasTenantQueryClause) ModifyStatement

func (sd HasTenantQueryClause) ModifyStatement(stmt *gorm.Statement)

func (HasTenantQueryClause) Name

func (sd HasTenantQueryClause) Name() string

type HasTenantUpdateClause added in v0.6.1

type HasTenantUpdateClause struct {
	Field *schema.Field
}

func (HasTenantUpdateClause) Build added in v0.6.1

func (HasTenantUpdateClause) MergeClause added in v0.6.1

func (sd HasTenantUpdateClause) MergeClause(*clause.Clause)

func (HasTenantUpdateClause) ModifyStatement added in v0.6.1

func (sd HasTenantUpdateClause) ModifyStatement(stmt *gorm.Statement)

func (HasTenantUpdateClause) Name added in v0.6.1

func (sd HasTenantUpdateClause) Name() string

type MultiTenancy

type MultiTenancy struct {
	TenantId HasTenant `gorm:"index"`
}

MultiTenancy entity

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL