gorm

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: MIT Imports: 9 Imported by: 18

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

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

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

type HasTenantDeleteClause struct {
	Field *schema.Field
}

func (HasTenantDeleteClause) Build

func (HasTenantDeleteClause) MergeClause

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

func (HasTenantDeleteClause) ModifyStatement

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

func (HasTenantDeleteClause) Name

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

type HasTenantUpdateClause struct {
	Field *schema.Field
}

func (HasTenantUpdateClause) Build

func (HasTenantUpdateClause) MergeClause

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

func (HasTenantUpdateClause) ModifyStatement

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

func (HasTenantUpdateClause) Name

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