gorm

package module
v0.0.0-...-d383251 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2020 License: MIT Imports: 3 Imported by: 0

README

gorm

A gorm wrapper

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeGorm

type FakeGorm struct {
	mock.Mock
}

func (*FakeGorm) AddError

func (f *FakeGorm) AddError(err error) error

func (*FakeGorm) AddForeignKey

func (f *FakeGorm) AddForeignKey(field string, dest string, onDelete string, onUpdate string) Gorm

func (*FakeGorm) AddIndex

func (f *FakeGorm) AddIndex(indexName string, columns ...string) Gorm

func (*FakeGorm) AddUniqueIndex

func (f *FakeGorm) AddUniqueIndex(indexName string, columns ...string) Gorm

func (*FakeGorm) Assign

func (f *FakeGorm) Assign(attrs ...interface{}) Gorm

func (*FakeGorm) Association

func (f *FakeGorm) Association(column string) *gorm.Association

func (*FakeGorm) Attrs

func (f *FakeGorm) Attrs(attrs ...interface{}) Gorm

func (*FakeGorm) AutoMigrate

func (f *FakeGorm) AutoMigrate(values ...interface{}) Gorm

func (*FakeGorm) Begin

func (f *FakeGorm) Begin() Gorm

func (*FakeGorm) Callback

func (f *FakeGorm) Callback() *gorm.Callback

func (*FakeGorm) Close

func (f *FakeGorm) Close() error

func (*FakeGorm) Commit

func (f *FakeGorm) Commit() Gorm

func (*FakeGorm) CommonDB

func (f *FakeGorm) CommonDB() gorm.SQLCommon

func (*FakeGorm) Count

func (f *FakeGorm) Count(value interface{}) Gorm

func (*FakeGorm) Create

func (f *FakeGorm) Create(value interface{}) Gorm

func (*FakeGorm) CreateTable

func (f *FakeGorm) CreateTable(values ...interface{}) Gorm

func (*FakeGorm) DB

func (f *FakeGorm) DB() *sql.DB

func (*FakeGorm) Debug

func (f *FakeGorm) Debug() Gorm

func (*FakeGorm) Delete

func (f *FakeGorm) Delete(value interface{}, where ...interface{}) Gorm

func (*FakeGorm) DropColumn

func (f *FakeGorm) DropColumn(column string) Gorm

func (*FakeGorm) DropTable

func (f *FakeGorm) DropTable(values ...interface{}) Gorm

func (*FakeGorm) DropTableIfExists

func (f *FakeGorm) DropTableIfExists(values ...interface{}) Gorm

func (*FakeGorm) Error

func (f *FakeGorm) Error() error

func (*FakeGorm) Exec

func (f *FakeGorm) Exec(sql string, values ...interface{}) Gorm

func (*FakeGorm) Find

func (f *FakeGorm) Find(out interface{}, where ...interface{}) Gorm

func (*FakeGorm) First

func (f *FakeGorm) First(out interface{}, where ...interface{}) Gorm

func (*FakeGorm) FirstOrCreate

func (f *FakeGorm) FirstOrCreate(out interface{}, where ...interface{}) Gorm

func (*FakeGorm) FirstOrInit

func (f *FakeGorm) FirstOrInit(out interface{}, where ...interface{}) Gorm

func (*FakeGorm) Get

func (f *FakeGorm) Get(name string) (interface{}, bool)

func (*FakeGorm) GetErrors

func (f *FakeGorm) GetErrors() (errors []error)

func (*FakeGorm) Group

func (f *FakeGorm) Group(query string) Gorm

func (*FakeGorm) HasTable

func (f *FakeGorm) HasTable(value interface{}) bool

func (*FakeGorm) Having

func (f *FakeGorm) Having(query string, values ...interface{}) Gorm

func (*FakeGorm) InstantSet

func (f *FakeGorm) InstantSet(name string, value interface{}) Gorm

func (*FakeGorm) Joins

func (f *FakeGorm) Joins(query string, args ...interface{}) Gorm

func (*FakeGorm) Last

func (f *FakeGorm) Last(out interface{}, where ...interface{}) Gorm

func (*FakeGorm) Limit

func (f *FakeGorm) Limit(value int) Gorm

func (*FakeGorm) LogMode

func (f *FakeGorm) LogMode(enable bool) Gorm

func (*FakeGorm) Model

func (f *FakeGorm) Model(value interface{}) Gorm

func (*FakeGorm) ModifyColumn

func (f *FakeGorm) ModifyColumn(column string, typ string) Gorm

func (*FakeGorm) New

func (f *FakeGorm) New() Gorm

func (*FakeGorm) NewRecord

func (f *FakeGorm) NewRecord(value interface{}) bool

func (*FakeGorm) NewScope

func (f *FakeGorm) NewScope(value interface{}) *gorm.Scope

func (*FakeGorm) Not

func (f *FakeGorm) Not(query interface{}, args ...interface{}) Gorm

func (*FakeGorm) Offset

func (f *FakeGorm) Offset(value int) Gorm

func (*FakeGorm) Omit

func (f *FakeGorm) Omit(columns ...string) Gorm

func (*FakeGorm) Or

func (f *FakeGorm) Or(query interface{}, args ...interface{}) Gorm

func (*FakeGorm) Order

func (f *FakeGorm) Order(value string, reorder ...bool) Gorm

func (*FakeGorm) Pluck

func (f *FakeGorm) Pluck(column string, value interface{}) Gorm

func (*FakeGorm) Preload

func (f *FakeGorm) Preload(column string, conditions ...interface{}) Gorm

func (*FakeGorm) Raw

func (f *FakeGorm) Raw(sql string, values ...interface{}) Gorm

func (*FakeGorm) RecordNotFound

func (f *FakeGorm) RecordNotFound() bool

func (*FakeGorm) Related

func (f *FakeGorm) Related(value interface{}, foreignKeys ...string) Gorm

func (*FakeGorm) RemoveIndex

func (f *FakeGorm) RemoveIndex(indexName string) Gorm

func (*FakeGorm) Rollback

func (f *FakeGorm) Rollback() Gorm

func (*FakeGorm) RollbackUnlessCommitted

func (f *FakeGorm) RollbackUnlessCommitted() Gorm

func (*FakeGorm) Row

func (f *FakeGorm) Row() *sql.Row

func (*FakeGorm) Rows

func (f *FakeGorm) Rows() (*sql.Rows, error)

func (*FakeGorm) RowsAffected

func (f *FakeGorm) RowsAffected() int64

func (*FakeGorm) Save

func (f *FakeGorm) Save(value interface{}) Gorm

func (*FakeGorm) Scan

func (f *FakeGorm) Scan(dest interface{}) Gorm

func (*FakeGorm) ScanRows

func (f *FakeGorm) ScanRows(rows *sql.Rows, result interface{}) error

func (*FakeGorm) Scopes

func (f *FakeGorm) Scopes(funcs ...func(*gorm.DB) *gorm.DB) Gorm

func (*FakeGorm) Select

func (f *FakeGorm) Select(query interface{}, args ...interface{}) Gorm

func (*FakeGorm) Set

func (f *FakeGorm) Set(name string, value interface{}) Gorm

func (*FakeGorm) SetJoinTableHandler

func (f *FakeGorm) SetJoinTableHandler(source interface{}, column string, handler gorm.JoinTableHandlerInterface)

func (*FakeGorm) SetLogger

func (f *FakeGorm) SetLogger(log gorm.Logger)

func (*FakeGorm) SingularTable

func (f *FakeGorm) SingularTable(enable bool)

func (*FakeGorm) Table

func (f *FakeGorm) Table(name string) Gorm

func (*FakeGorm) Transaction

func (f *FakeGorm) Transaction(fc func(tx *gorm.DB) error) error

func (*FakeGorm) Unscoped

func (f *FakeGorm) Unscoped() Gorm

func (*FakeGorm) Update

func (f *FakeGorm) Update(attrs ...interface{}) Gorm

func (*FakeGorm) UpdateColumn

func (f *FakeGorm) UpdateColumn(attrs ...interface{}) Gorm

func (*FakeGorm) UpdateColumns

func (f *FakeGorm) UpdateColumns(values interface{}) Gorm

func (*FakeGorm) Updates

func (f *FakeGorm) Updates(values interface{}, ignoreProtectedAttrs ...bool) Gorm

func (*FakeGorm) Where

func (f *FakeGorm) Where(query interface{}, args ...interface{}) Gorm

type Gorm

type Gorm interface {
	Close() error
	DB() *sql.DB
	New() Gorm
	NewScope(value interface{}) *gorm.Scope
	CommonDB() gorm.SQLCommon
	Callback() *gorm.Callback
	SetLogger(l gorm.Logger)
	LogMode(enable bool) Gorm
	SingularTable(enable bool)
	Where(query interface{}, args ...interface{}) Gorm
	Or(query interface{}, args ...interface{}) Gorm
	Not(query interface{}, args ...interface{}) Gorm
	Limit(value int) Gorm
	Offset(value int) Gorm
	Order(value string, reorder ...bool) Gorm
	Select(query interface{}, args ...interface{}) Gorm
	Omit(columns ...string) Gorm
	Group(query string) Gorm
	Having(query string, values ...interface{}) Gorm
	Joins(query string, args ...interface{}) Gorm
	Scopes(funcs ...func(*gorm.DB) *gorm.DB) Gorm
	Unscoped() Gorm
	Attrs(attrs ...interface{}) Gorm
	Assign(attrs ...interface{}) Gorm
	First(out interface{}, where ...interface{}) Gorm
	Last(out interface{}, where ...interface{}) Gorm
	Find(out interface{}, where ...interface{}) Gorm
	Scan(dest interface{}) Gorm
	Row() *sql.Row
	Rows() (*sql.Rows, error)
	ScanRows(rows *sql.Rows, result interface{}) error
	Pluck(column string, value interface{}) Gorm
	Count(value interface{}) Gorm
	Related(value interface{}, foreignKeys ...string) Gorm
	FirstOrInit(out interface{}, where ...interface{}) Gorm
	FirstOrCreate(out interface{}, where ...interface{}) Gorm
	Update(attrs ...interface{}) Gorm
	Updates(values interface{}, ignoreProtectedAttrs ...bool) Gorm
	UpdateColumn(attrs ...interface{}) Gorm
	UpdateColumns(values interface{}) Gorm
	Save(value interface{}) Gorm
	Create(value interface{}) Gorm
	Delete(value interface{}, where ...interface{}) Gorm
	Raw(sql string, values ...interface{}) Gorm
	Exec(sql string, values ...interface{}) Gorm
	Model(value interface{}) Gorm
	Table(name string) Gorm
	Debug() Gorm
	Transaction(fc func(tx *gorm.DB) error) error
	Begin() Gorm
	Commit() Gorm
	Rollback() Gorm
	RollbackUnlessCommitted() Gorm
	NewRecord(value interface{}) bool
	RecordNotFound() bool
	CreateTable(values ...interface{}) Gorm
	DropTable(values ...interface{}) Gorm
	DropTableIfExists(values ...interface{}) Gorm
	HasTable(value interface{}) bool
	AutoMigrate(values ...interface{}) Gorm
	ModifyColumn(column string, typ string) Gorm
	DropColumn(column string) Gorm
	AddIndex(indexName string, column ...string) Gorm
	AddUniqueIndex(indexName string, column ...string) Gorm
	RemoveIndex(indexName string) Gorm
	AddForeignKey(field string, dest string, onDelete string, onUpdate string) Gorm
	Association(column string) *gorm.Association
	Preload(column string, conditions ...interface{}) Gorm
	Set(name string, value interface{}) Gorm
	InstantSet(name string, value interface{}) Gorm
	Get(name string) (value interface{}, ok bool)
	SetJoinTableHandler(source interface{}, column string, handler gorm.JoinTableHandlerInterface)
	AddError(err error) error
	GetErrors() (errors []error)

	// extra
	Error() error
	RowsAffected() int64
}

Gorm is an interface which DB implements

func Open

func Open(dialect string, args ...interface{}) (db Gorm, err error)

Open is a drop-in replacement for Open()

type Model

type Model gorm.Model

Jump to

Keyboard shortcuts

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