typed

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainExecInterface

type ChainExecInterface[T any] interface {
	gorm.ExecInterface[T]

	Delete(ctx context.Context) (rowsAffected int, err error)
	Update(ctx context.Context, name string, value any) (rowsAffected int, err error)
	Updates(ctx context.Context, t T) (rowsAffected int, err error)
	Count(ctx context.Context, column string) (result int64, err error)

	Set(assignments ...clause.Assigner) gorm.SetUpdateOnlyInterface[T]
}

type ChainInterface

type ChainInterface[T any] interface {
	ChainExecInterface[T]
	Scopes(scopes ...func(db *gorm.Statement)) ChainInterface[T]
	Where(...field.QueryInterface) ChainInterface[T]
	Not(...field.QueryInterface) ChainInterface[T]
	Or(...field.QueryInterface) ChainInterface[T]
	Limit(offset int) ChainInterface[T]
	Offset(offset int) ChainInterface[T]
	Joins(query clause.JoinTarget, on func(db JoinBuilder, joinTable clause.Table, curTable clause.Table) error) ChainInterface[T]
	Preload(assoc field.AssociationInterface, query func(db PreloadBuilder) error) ChainInterface[T]
	Select(...field.Selectable) ChainInterface[T]
	Omit(...field.ColumnInterface) ChainInterface[T]
	MapColumns(m map[string]string) ChainInterface[T]
	Distinct(...field.ColumnInterface) ChainInterface[T]
	Group(field.ColumnInterface) ChainInterface[T]
	Having(...field.QueryInterface) ChainInterface[T]
	Order(field.OrderableInterface) ChainInterface[T]

	Table(name string, args ...interface{}) ChainInterface[T]
	Build(builder clause.Builder)
}

type CreateInterface

type CreateInterface[T any] interface {
	gorm.ExecInterface[T]
	Scopes(scopes ...func(db *gorm.Statement)) ChainInterface[T]
	Where(...field.QueryInterface) ChainInterface[T]
	Not(...field.QueryInterface) ChainInterface[T]
	Or(...field.QueryInterface) ChainInterface[T]
	Limit(offset int) ChainInterface[T]
	Offset(offset int) ChainInterface[T]
	Joins(query clause.JoinTarget, on func(db JoinBuilder, joinTable clause.Table, curTable clause.Table) error) ChainInterface[T]
	Preload(assoc field.AssociationInterface, query func(db PreloadBuilder) error) ChainInterface[T]
	Select(...field.Selectable) ChainInterface[T]
	Omit(...field.ColumnInterface) ChainInterface[T]
	MapColumns(m map[string]string) ChainInterface[T]
	Distinct(...field.ColumnInterface) ChainInterface[T]
	Group(sel field.ColumnInterface) ChainInterface[T]
	Having(...field.QueryInterface) ChainInterface[T]
	Order(field.OrderableInterface) ChainInterface[T]

	Delete(ctx context.Context) (rowsAffected int, err error)
	Update(ctx context.Context, name string, value any) (rowsAffected int, err error)
	Updates(ctx context.Context, t T) (rowsAffected int, err error)
	Count(ctx context.Context, column string) (result int64, err error)

	Table(name string, args ...interface{}) CreateInterface[T]
	Create(ctx context.Context, r *T) error
	CreateInBatches(ctx context.Context, r *[]T, batchSize int) error

	Build(builder clause.Builder)
	Set(assignments ...clause.Assigner) gorm.SetCreateOrUpdateInterface[T]
}

type Interface

type Interface[T any] interface {
	Raw(sql string, values ...any) gorm.ExecInterface[T]
	Exec(ctx context.Context, sql string, values ...interface{}) error
	CreateInterface[T]
}

func G

func G[T any](db *gorm.DB, opts ...clause.Expression) Interface[T]

type JoinBuilder

Builder adapters used in callbacks

Jump to

Keyboard shortcuts

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