Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 32 for indexOf (0.17 sec)

  1. callbacks/callmethod.go

    		switch db.Statement.ReflectValue.Kind() {
    		case reflect.Slice, reflect.Array:
    			db.Statement.CurDestIndex = 0
    			for i := 0; i < db.Statement.ReflectValue.Len(); i++ {
    				if value := reflect.Indirect(db.Statement.ReflectValue.Index(i)); value.CanAddr() {
    					fc(value.Addr().Interface(), tx)
    				} else {
    					db.AddError(gorm.ErrInvalidValue)
    					return
    				}
    				db.Statement.CurDestIndex++
    			}
    		case reflect.Struct:
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Feb 18 01:20:29 GMT 2023
    - 846 bytes
    - Viewed (0)
  2. callbacks/preload.go

    						reflectValue.SetLen(rv.Len())
    						for i := 0; i < rv.Len(); i++ {
    							frv := rel.Field.ReflectValueOf(db.Statement.Context, rv.Index(i))
    							if frv.Kind() != reflect.Ptr {
    								reflectValue.Index(i).Set(frv.Addr())
    							} else {
    								reflectValue.Index(i).Set(frv)
    							}
    						}
    
    						tx := preloadDB(db, reflectValue, reflectValue.Interface())
    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. README.md

    * Developer Friendly
    
    ## Getting Started
    
    * GORM Guides [https://gorm.io](https://gorm.io)
    * Gen Guides [https://gorm.io/gen/index.html](https://gorm.io/gen/index.html)
    
    ## Contributing
    
    [You can help to deliver a better GORM, check out things you can do](https://gorm.io/contribute.html)
    
    ## Contributors
    
    [Thank you](https://github.com/go-gorm/gorm/graphs/contributors) for contributing to the GORM framework!
    
    Plain Text
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Nov 07 02:20:06 GMT 2023
    - 1.8K bytes
    - Viewed (0)
  4. statement.go

    				if len(fromCallbacks) > 0 {
    					for i := 0; i < stmt.ReflectValue.Len(); i++ {
    						stmt.AddError(field.Set(stmt.Context, stmt.ReflectValue.Index(i), value))
    					}
    				} else {
    					stmt.AddError(field.Set(stmt.Context, stmt.ReflectValue.Index(stmt.CurDestIndex), value))
    				}
    			case reflect.Struct:
    				if !stmt.ReflectValue.CanAddr() {
    					stmt.AddError(ErrInvalidValue)
    					return
    				}
    
    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)
  5. schema/model_test.go

    	Admin        *mybool
    }
    
    type BaseModel struct {
    	ID        uint
    	CreatedAt time.Time
    	CreatedBy *int
    	Created   *VersionUser `gorm:"foreignKey:CreatedBy"`
    	UpdatedAt time.Time
    	DeletedAt gorm.DeletedAt `gorm:"index"`
    }
    
    type VersionModel struct {
    	BaseModel
    	Version int
    }
    
    type VersionUser struct {
    	VersionModel
    	Name     string
    	Age      uint
    	Birthday *time.Time
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 1.1K bytes
    - Viewed (0)
  6. callbacks/update.go

    		assignValue = func(field *schema.Field, value interface{}) {
    			for i := 0; i < stmt.ReflectValue.Len(); i++ {
    				if stmt.ReflectValue.CanAddr() {
    					field.Set(stmt.Context, stmt.ReflectValue.Index(i), value)
    				}
    			}
    		}
    	case reflect.Struct:
    		assignValue = func(field *schema.Field, value interface{}) {
    			if stmt.ReflectValue.CanAddr() {
    				field.Set(stmt.Context, stmt.ReflectValue, value)
    			}
    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)
  7. callbacks/helper.go

    	if v.Kind() == reflect.Ptr {
    		v = v.Elem()
    	}
    
    	switch v.Kind() {
    	case reflect.Slice, reflect.Array:
    		loaded = true
    		for i := 0; i < v.Len(); i++ {
    			if !loadOrStoreVisitMap(visitMap, v.Index(i)) {
    				loaded = false
    			}
    		}
    	case reflect.Struct, reflect.Interface:
    		if v.CanAddr() {
    			p := v.Addr()
    			if _, ok := (*visitMap)[p]; ok {
    				return true
    			}
    			(*visitMap)[p] = true
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 14 12:32:57 GMT 2022
    - 3.7K bytes
    - Viewed (0)
  8. schema/schema_test.go

    		{Name: "UpdatedAt", DBName: "updated_at", BindNames: []string{"Model", "UpdatedAt"}, DataType: schema.Time},
    		{Name: "DeletedAt", DBName: "deleted_at", BindNames: []string{"Model", "DeletedAt"}, Tag: `gorm:"index"`, DataType: schema.Time},
    		{Name: "Name", DBName: "name", BindNames: []string{"Name"}, DataType: schema.String},
    		{Name: "Age", DBName: "age", BindNames: []string{"Age"}, DataType: schema.Uint, Size: 64},
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 12.9K bytes
    - Viewed (0)
  9. association.go

    	for _, assignBack := range assignBacks {
    		fieldValue := reflect.Indirect(association.Relationship.Field.ReflectValueOf(association.DB.Statement.Context, assignBack.Source))
    		if assignBack.Index > 0 {
    			reflect.Indirect(assignBack.Dest).Set(fieldValue.Index(assignBack.Index - 1))
    		} else {
    			reflect.Indirect(assignBack.Dest).Set(fieldValue)
    		}
    	}
    }
    
    func (association *Association) buildCondition() *DB {
    	var (
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu May 04 11:30:45 GMT 2023
    - 21.2K bytes
    - Viewed (0)
  10. schema/field.go

    				}
    				// index is negative means is pointer
    				if field.FieldType.Kind() == reflect.Struct {
    					ef.StructField.Index = append([]int{fieldStruct.Index[0]}, ef.StructField.Index...)
    				} else {
    					ef.StructField.Index = append([]int{-fieldStruct.Index[0] - 1}, ef.StructField.Index...)
    				}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
Back to top