Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for SkipHooks (0.2 sec)

  1. 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()
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 05:44:55 GMT 2024
    - 9.4K bytes
    - Viewed (1)
  2. callbacks/preload.go

    						return err
    					}
    				default:
    					return gorm.ErrInvalidData
    				}
    			} else {
    				tx := db.Table("").Session(&gorm.Session{Context: db.Statement.Context, SkipHooks: db.Statement.SkipHooks})
    				tx.Statement.ReflectValue = db.Statement.ReflectValue
    				tx.Statement.Unscoped = db.Statement.Unscoped
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  3. 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 {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 08 03:29:55 GMT 2024
    - 12.5K bytes
    - Viewed (0)
  4. 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)
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 22.7K bytes
    - Viewed (0)
  5. 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...)
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 19.8K bytes
    - Viewed (0)
  6. callbacks/query.go

    	}
    }
    
    func AfterQuery(db *gorm.DB) {
    	// clear the joins after query because preload need it
    	db.Statement.Joins = nil
    	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
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Jan 29 03:34:57 GMT 2024
    - 9.9K bytes
    - Viewed (0)
Back to top