- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 10 for SkipHooks (0.12 sec)
-
callbacks/update.go
if v, ok := selectColumns[field.DBName]; (ok && v) || (!ok && (!restricted || (!stmt.SkipHooks && field.AutoUpdateTime > 0))) { value, isZero := field.ValueOf(stmt.Context, updatingValue) if !stmt.SkipHooks && field.AutoUpdateTime > 0 { if field.AutoUpdateTime == schema.UnixNanosecond { value = stmt.DB.NowFunc().UnixNano()
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Mar 18 05:44:55 UTC 2024 - 9.4K bytes - Viewed (0) -
callbacks/preload.go
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed Jun 12 10:52:33 UTC 2024 - 11.6K bytes - Viewed (0) -
callbacks/associations.go
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Tue Apr 11 03:06:13 UTC 2023 - 14.3K bytes - Viewed (0) -
gorm.go
Mux: preparedStmt.Mux, Stmts: preparedStmt.Stmts, } } txConfig.ConnPool = tx.Statement.ConnPool txConfig.PrepareStmt = true } if config.SkipHooks { tx.Statement.SkipHooks = true } if config.DisableNestedTransaction { txConfig.DisableNestedTransaction = true } if !config.NewDB { tx.clone = 2 } if config.DryRun {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed Oct 09 11:29:48 UTC 2024 - 12.1K bytes - Viewed (0) -
tests/hooks_test.go
DB.Model(&product).Session(&gorm.Session{SkipHooks: true}).Updates(Product3{Code: "L1216"}) if product.Price != 320 || product.Code != "L1216" { t.Errorf("invalid data after update, got %+v", product) } var result2 Product3 DB.First(&result2, product.ID) AssertEqual(t, result2, product) product2 := Product3{Name: "Product", Price: 0} DB.Session(&gorm.Session{SkipHooks: true}).Create(&product2)
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Jun 17 03:59:06 UTC 2024 - 16.7K bytes - Viewed (0) -
callbacks/create.go
"gorm.io/gorm/clause" "gorm.io/gorm/schema" "gorm.io/gorm/utils" ) // BeforeCreate before create hooks func BeforeCreate(db *gorm.DB) { if db.Error == nil && db.Statement.Schema != nil && !db.Statement.SkipHooks && (db.Statement.Schema.BeforeSave || db.Statement.Schema.BeforeCreate) { callMethod(db, func(value interface{}, tx *gorm.DB) (called bool) { if db.Statement.Schema.BeforeSave { if i, ok := value.(BeforeSaveInterface); ok {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Apr 08 03:29:55 UTC 2024 - 12.5K bytes - Viewed (0) -
callbacks/delete.go
"reflect" "strings" "gorm.io/gorm" "gorm.io/gorm/clause" "gorm.io/gorm/schema" "gorm.io/gorm/utils" ) func BeforeDelete(db *gorm.DB) { if db.Error == nil && db.Statement.Schema != nil && !db.Statement.SkipHooks && db.Statement.Schema.BeforeDelete { callMethod(db, func(value interface{}, tx *gorm.DB) bool { if i, ok := value.(BeforeDeleteInterface); ok { db.AddError(i.BeforeDelete(tx)) return true }
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Fri Feb 25 02:48:23 UTC 2022 - 5.6K bytes - Viewed (0) -
statement.go
ConnPool: stmt.ConnPool, Schema: stmt.Schema, Context: stmt.Context, RaiseErrorOnNotFound: stmt.RaiseErrorOnNotFound, SkipHooks: stmt.SkipHooks, } if stmt.SQL.Len() > 0 { newStmt.SQL.WriteString(stmt.SQL.String()) newStmt.Vars = make([]interface{}, 0, len(stmt.Vars)) newStmt.Vars = append(newStmt.Vars, stmt.Vars...) }
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Jun 24 09:42:59 UTC 2024 - 19.9K bytes - Viewed (0) -
finisher_api.go
tx = db.getInstance() tx.Statement.Dest = map[string]interface{}{column: value} tx.Statement.SkipHooks = true return tx.callbacks.Update().Execute(tx) } func (db *DB) UpdateColumns(values interface{}) (tx *DB) { tx = db.getInstance() tx.Statement.Dest = values tx.Statement.SkipHooks = true return tx.callbacks.Update().Execute(tx) }
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Sat Sep 14 12:58:29 UTC 2024 - 22.8K bytes - Viewed (0) -
callbacks/query.go
db.Statement.Clauses["FROM"] = fromClause } if db.Error == nil && db.Statement.Schema != nil && !db.Statement.SkipHooks && db.Statement.Schema.AfterFind && db.RowsAffected > 0 { callMethod(db, func(value interface{}, tx *gorm.DB) bool { if i, ok := value.(AfterFindInterface); ok { db.AddError(i.AfterFind(tx)) return true
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Thu Aug 22 11:03:42 UTC 2024 - 10.1K bytes - Viewed (1)