package callbacks
Import Path
gorm.io/gorm/callbacks (on go.dev)
Dependency Relation
imports 8 packages, and imported by 2 packages
Involved Source Files
associations.go
Package callbacks provides the default callback functions for GORM operations such as create, query, update, and delete.
callmethod.go
create.go
delete.go
helper.go
interfaces.go
preload.go
query.go
raw.go
row.go
transaction.go
update.go
Package-Level Type Names (total 10)
( AfterCreateInterface) AfterCreate(*gorm.DB) error
( AfterDeleteInterface) AfterDelete(*gorm.DB) error
( AfterUpdateInterface) AfterUpdate(*gorm.DB) error
( BeforeCreateInterface) BeforeCreate(*gorm.DB) error
( BeforeDeleteInterface) BeforeDelete(*gorm.DB) error
( BeforeSaveInterface) BeforeSave(*gorm.DB) error
( BeforeUpdateInterface) BeforeUpdate(*gorm.DB) error
CreateClauses []string
DeleteClauses []string
LastInsertIDReversed bool
QueryClauses []string
UpdateClauses []string
func Create(config *Config) func(db *gorm.DB)
func Delete(config *Config) func(db *gorm.DB)
func RegisterDefaultCallbacks(db *gorm.DB, config *Config)
func Update(config *Config) func(db *gorm.DB)
Package-Level Functions (total 26)
AfterCreate after create hooks
func AfterDelete(db *gorm.DB) func AfterQuery(db *gorm.DB)
AfterUpdate after update hooks
BeforeCreate before create hooks
func BeforeDelete(db *gorm.DB)
BeforeUpdate before update hooks
func BeginTransaction(db *gorm.DB) func BuildQuerySQL(db *gorm.DB) func CommitOrRollbackTransaction(db *gorm.DB)
ConvertMapToValuesForCreate convert map to values
ConvertSliceOfMapToValuesForCreate convert slice of map to values
ConvertToAssignments convert to update assignments
ConvertToCreateValues convert to create values
Create create hook
func DeleteBeforeAssociations(db *gorm.DB) func RegisterDefaultCallbacks(db *gorm.DB, config *Config) func SaveAfterAssociations(create bool) func(db *gorm.DB) func SaveBeforeAssociations(create bool) func(db *gorm.DB) func SetupUpdateReflectValue(db *gorm.DB)
Update update hook
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |