orm

package
v1.1.15 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	Query
	Begin() (Transaction, error)
	Instance() *gorm.DB
}

type Driver

type Driver string
const (
	DriverMysql      Driver = "mysql"
	DriverPostgresql Driver = "postgresql"
	DriverSqlite     Driver = "sqlite"
	DriverSqlserver  Driver = "sqlserver"
)

func (Driver) String

func (d Driver) String() string

type Orm

type Orm interface {
	Connection(name string, config *gorm.Config, disableLog bool) Orm
	Query(database ...string) DB
	Transaction(txFunc func(tx Transaction) error) error
	WithContext(ctx context.Context) Orm
}

type Query

type Query interface {
	WithContext(ctx context.Context) Query
	Driver() Driver
	Instance() *gorm.DB
	Count(count *int64) *gorm.DB
	Create(value any) *gorm.DB
	Delete(value any, conds ...any) *gorm.DB
	Distinct(args ...any) Query
	Exec(sql string, values ...any) *gorm.DB
	Find(dest any, conds ...any) *gorm.DB
	First(dest any) *gorm.DB
	FirstOrCreate(dest any, conds ...any) *gorm.DB
	ForceDelete(value any, conds ...any) *gorm.DB
	Get(dest any) *gorm.DB
	Group(name string) Query
	Having(query any, args ...any) Query
	Join(query string, args ...any) Query
	Limit(limit int) Query
	Model(value any) Query
	Offset(offset int) Query
	Order(value any) Query
	OrWhere(query any, args ...any) Query
	Pluck(column string, dest any) *gorm.DB
	Raw(sql string, values ...any) Query
	Save(value any) *gorm.DB
	Scan(dest any) *gorm.DB
	Scopes(funcs ...func(Query) Query) Query
	Select(query any, args ...any) Query
	Table(name string, args ...any) Query
	Update(column string, value any) *gorm.DB
	Updates(values any) *gorm.DB
	Where(query any, args ...any) Query
	With(query string, args ...any) Query
	WithTrashed() Query
	Fields(schema, name string) (fields []string, err error)
}

type Transaction

type Transaction interface {
	Query
	Commit() *gorm.DB
	Rollback() *gorm.DB
}

Jump to

Keyboard shortcuts

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