Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for Settings (0.17 sec)

  1. callbacks/associations.go

    		FullSaveAssociations:     db.FullSaveAssociations,
    		SkipHooks:                db.Statement.SkipHooks,
    		DisableNestedTransaction: true,
    	})
    
    	db.Statement.Settings.Range(func(k, v interface{}) bool {
    		tx.Statement.Settings.Store(k, v)
    		return true
    	})
    
    	if tx.Statement.FullSaveAssociations {
    		tx = tx.Set("gorm:update_track_time", true)
    	}
    
    	if len(selects) > 0 {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Apr 11 03:06:13 GMT 2023
    - 14.3K bytes
    - Viewed (0)
  2. callbacks/create.go

    	default:
    		var (
    			selectColumns, restricted = stmt.SelectAndOmitColumns(true, false)
    			_, updateTrackTime        = stmt.Get("gorm:update_track_time")
    			isZero                    bool
    		)
    		stmt.Settings.Delete("gorm:update_track_time")
    
    		values = clause.Values{Columns: make([]clause.Column, 0, len(stmt.Schema.DBNames))}
    
    		for _, db := range stmt.Schema.DBNames {
    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)
  3. chainable_api.go

    	tx = db.getInstance()
    	tx.Statement.assigns = attrs
    	return
    }
    
    // Unscoped disables the global scope of soft deletion in a query.
    // By default, GORM uses soft deletion, marking records as "deleted"
    // by setting a timestamp on a specific field (e.g., `deleted_at`).
    // Unscoped allows queries to include records marked as deleted,
    // overriding the soft deletion behavior.
    // Example:
    //    var users []User
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Apr 17 03:38:55 GMT 2024
    - 14.3K bytes
    - Viewed (1)
  4. finisher_api.go

    }
    
    // Delete deletes value matching given conditions. If value contains primary key it is included in the conditions. If
    // value includes a deleted_at field, then Delete performs a soft delete instead by setting deleted_at with the current
    // time if null.
    func (db *DB) Delete(value interface{}, conds ...interface{}) (tx *DB) {
    	tx = db.getInstance()
    	if len(conds) > 0 {
    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. callbacks/preload.go

    	tx := db.Session(&gorm.Session{Context: db.Statement.Context, NewDB: true, SkipHooks: db.Statement.SkipHooks, Initialized: true})
    	db.Statement.Settings.Range(func(k, v interface{}) bool {
    		tx.Statement.Settings.Store(k, v)
    		return true
    	})
    
    	if err := tx.Statement.Parse(dest); err != nil {
    		tx.AddError(err)
    		return tx
    	}
    	tx.Statement.ReflectValue = reflectValue
    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)
  6. tests/update_test.go

    		Where("id = ?", elem.Id).
    		Updates(&ElementWithIgnoredField{Value: "bar", IgnoredField: 100})
    
    	var result ElementWithIgnoredField
    	if err := DB.First(&result, elem.Id).Error; err != nil {
    		t.Errorf("error getting an element from database: %s", err.Error())
    	}
    
    	if result.IgnoredField != 0 {
    		t.Errorf("element's ignored field should not be updated")
    	}
    }
    
    func TestUpdateFromSubQuery(t *testing.T) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Dec 04 03:50:58 GMT 2023
    - 30.3K bytes
    - Viewed (0)
  7. statement.go

    		copy(newStmt.Joins, stmt.Joins)
    	}
    
    	if len(stmt.scopes) > 0 {
    		newStmt.scopes = make([]func(*DB) *DB, len(stmt.scopes))
    		copy(newStmt.scopes, stmt.scopes)
    	}
    
    	stmt.Settings.Range(func(k, v interface{}) bool {
    		newStmt.Settings.Store(k, v)
    		return true
    	})
    
    	return newStmt
    }
    
    // SetColumn set column's value
    //
    //	stmt.SetColumn("Name", "jinzhu") // Hooks Method
    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)
  8. gorm.go

    func (db *DB) Set(key string, value interface{}) *DB {
    	tx := db.getInstance()
    	tx.Statement.Settings.Store(key, value)
    	return tx
    }
    
    // Get get value with key from current db instance's context
    func (db *DB) Get(key string) (interface{}, bool) {
    	return db.Statement.Settings.Load(key)
    }
    
    // InstanceSet store value with key into current db instance's context
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sun Aug 20 11:46:56 GMT 2023
    - 11.6K bytes
    - Viewed (0)
  9. schema/relationship.go

    		name = str[0:idx]
    	} else {
    		name = rel.Schema.namer.RelationshipFKName(*rel)
    	}
    
    	constraint := Constraint{
    		Name:     name,
    		Field:    rel.Field,
    		OnUpdate: settings["ONUPDATE"],
    		OnDelete: settings["ONDELETE"],
    	}
    
    	for _, ref := range rel.References {
    		if ref.PrimaryKey != nil && (rel.JoinTable == nil || ref.OwnPrimaryKey) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 22.4K bytes
    - Viewed (0)
Back to top