Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for selectColumns (0.09 sec)

  1. callbacks/associations.go

    	return func(db *gorm.DB) {
    		if db.Error == nil && db.Statement.Schema != nil {
    			selectColumns, restricted := db.Statement.SelectAndOmitColumns(create, !create)
    
    			// Save Belongs To associations
    			for _, rel := range db.Statement.Schema.Relationships.BelongsTo {
    				if v, ok := selectColumns[rel.Name]; (ok && !v) || (!ok && restricted) {
    					continue
    				}
    
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Tue Apr 11 03:06:13 UTC 2023
    - 14.3K bytes
    - Viewed (0)
  2. callbacks/create.go

    			if stmt.Schema != nil && len(values.Columns) >= 1 {
    				selectColumns, restricted := stmt.SelectAndOmitColumns(true, true)
    
    				columns := make([]string, 0, len(values.Columns)-1)
    				for _, column := range values.Columns {
    					if field := stmt.Schema.LookUpField(column.Name); field != nil {
    						if v, ok := selectColumns[field.DBName]; (ok && v) || (!ok && !restricted) {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Apr 08 03:29:55 UTC 2024
    - 12.5K bytes
    - Viewed (0)
  3. callbacks/update.go

    				if field := stmt.Schema.LookUpField(k); field != nil {
    					if field.DBName != "" {
    						if v, ok := selectColumns[field.DBName]; (ok && v) || (!ok && !restricted) {
    							set = append(set, clause.Assignment{Column: clause.Column{Name: field.DBName}, Value: kv})
    							assignValue(field, value[k])
    						}
    					} else if v, ok := selectColumns[field.Name]; (ok && v) || (!ok && !restricted) {
    						assignValue(field, value[k])
    					}
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Mar 18 05:44:55 UTC 2024
    - 9.4K bytes
    - Viewed (0)
  4. callbacks/helper.go

    		selectColumns, restricted = stmt.SelectAndOmitColumns(true, false)
    	)
    
    	for idx, mapValue := range mapValues {
    		for k, v := range mapValue {
    			if stmt.Schema != nil {
    				if field := stmt.Schema.LookUpField(k); field != nil {
    					k = field.DBName
    				}
    			}
    
    			if _, ok := result[k]; !ok {
    				if v, ok := selectColumns[k]; (ok && v) || (!ok && !restricted) {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Thu Apr 14 12:32:57 UTC 2022
    - 3.7K bytes
    - Viewed (0)
  5. callbacks/query.go

    				}
    			}
    		} else if db.Statement.Schema != nil && len(db.Statement.Omits) > 0 {
    			selectColumns, _ := db.Statement.SelectAndOmitColumns(false, false)
    			clauseSelect.Columns = make([]clause.Column, 0, len(db.Statement.Schema.DBNames))
    			for _, dbName := range db.Statement.Schema.DBNames {
    				if v, ok := selectColumns[dbName]; (ok && v) || !ok {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Thu Aug 22 11:03:42 UTC 2024
    - 10.1K bytes
    - Viewed (1)
  6. callbacks/delete.go

    			return false
    		})
    	}
    }
    
    func DeleteBeforeAssociations(db *gorm.DB) {
    	if db.Error == nil && db.Statement.Schema != nil {
    		selectColumns, restricted := db.Statement.SelectAndOmitColumns(true, false)
    		if !restricted {
    			return
    		}
    
    		for column, v := range selectColumns {
    			if !v {
    				continue
    			}
    
    			rel, ok := db.Statement.Schema.Relationships.Relations[column]
    			if !ok {
    				continue
    			}
    
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Fri Feb 25 02:48:23 UTC 2022
    - 5.6K bytes
    - Viewed (0)
  7. association.go

    			}
    		}
    	}
    
    	selectedSaveColumns := []string{association.Relationship.Name}
    	omitColumns := []string{}
    	selectColumns, _ := association.DB.Statement.SelectAndOmitColumns(true, false)
    	for name, ok := range selectColumns {
    		columnName := ""
    		if strings.HasPrefix(name, association.Relationship.Name) {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed Jun 12 10:49:45 UTC 2024
    - 21.5K bytes
    - Viewed (0)
  8. statement.go

    	case reflect.Slice, reflect.Array:
    		modelValue = stmt.ReflectValue.Index(stmt.CurDestIndex)
    	}
    
    	selectColumns, restricted := stmt.SelectAndOmitColumns(false, true)
    	changed := func(field *schema.Field) bool {
    		fieldValue, _ := field.ValueOf(stmt.Context, modelValue)
    		if v, ok := selectColumns[field.DBName]; (ok && v) || (!ok && !restricted) {
    			if mv, mok := stmt.Dest.(map[string]interface{}); mok {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Jun 24 09:42:59 UTC 2024
    - 19.9K bytes
    - Viewed (0)
Back to top