Documentation ¶
Index ¶
- func FromDBName(dbname string) string
- type AllEntities
- type ChangedFields
- type Context
- func (c *Context) InTransaction(db *gorm.DB, itf InTransactionFunc) error
- func (c *Context) NewManyToMany(JoinTable string, ...) (*ManyToMany, error)
- func (c *Context) Preload(db *gorm.DB, params *PreloadParams) error
- func (c *Context) Save(db *gorm.DB, params *SaveParams) error
- func (c *Context) SaveNoTransaction(tx *gorm.DB, params *SaveParams) error
- func (c *Context) WalkType(riMap RecordInfoMap, name string, atyp reflect.Type, visited VisitMap, ...) (*RecordInfo, error)
- type DBCB
- type EntityMap
- type InTransactionFunc
- type JoinRec
- type ManyToMany
- type Node
- type PreloadCB
- type PreloadField
- type PreloadParams
- type RecordInfo
- type RecordInfoMap
- type SaveParams
- type ScopeMap
- type Stats
- type VisitMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromDBName ¶
Types ¶
type AllEntities ¶
type ChangedFields ¶
type ChangedFields map[string]interface{}
func DiffRecord ¶
func DiffRecord(x, y interface{}, scope *gorm.Scope) (ChangedFields, error)
type Context ¶
func NewContext ¶
func (*Context) InTransaction ¶
func (c *Context) InTransaction(db *gorm.DB, itf InTransactionFunc) error
func (*Context) NewManyToMany ¶
func (c *Context) NewManyToMany(JoinTable string, SourceForeignKeys, DestinationForeignKeys []gorm.JoinTableForeignKey) (*ManyToMany, error)
func (*Context) SaveNoTransaction ¶
func (c *Context) SaveNoTransaction(tx *gorm.DB, params *SaveParams) error
type ManyToMany ¶
type ManyToMany struct { Scope *gorm.Scope JoinTable string SourceName string SourceAssocName string SourceDBName string SourceAssocDBName string DestinName string DestinAssocName string DestinDBName string DestinAssocDBName string // SourceKey => []JoinRec{DestinKey, Record} Values map[interface{}][]JoinRec }
func (*ManyToMany) AddKeys ¶
func (mtm *ManyToMany) AddKeys(sourceKey interface{}, destinKey interface{}, record reflect.Value)
func (*ManyToMany) String ¶
func (mtm *ManyToMany) String() string
type Node ¶
type Node struct { Name string Field PreloadField Children map[string]*Node }
func (*Node) Add ¶
func (n *Node) Add(pf PreloadField)
type PreloadField ¶
type PreloadParams ¶
type PreloadParams struct { Record interface{} // Fields to preload, for example []string{"CollectionGames", "CollectionGames.Game"} Fields []PreloadField }
type RecordInfo ¶
type RecordInfo struct { Name string Type reflect.Type Children []*RecordInfo Relationship *gorm.Relationship ManyToMany *ManyToMany ModelStruct *gorm.ModelStruct }
func (*RecordInfo) String ¶
func (ri *RecordInfo) String() string
type RecordInfoMap ¶
type RecordInfoMap map[reflect.Type]*RecordInfo
type SaveParams ¶
type VisitMap ¶
type VisitMap map[*gorm.ModelStruct]bool
func (VisitMap) CopyAndMark ¶
func (vm VisitMap) CopyAndMark(ms *gorm.ModelStruct) VisitMap
Click to show internal directories.
Click to hide internal directories.