Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for _index (0.64 sec)

  1. scan.go

    			}
    
    			for initialized || rows.Next() {
    			BEGIN:
    				initialized = false
    
    				if update {
    					if int(db.RowsAffected) >= reflectValue.Len() {
    						return
    					}
    					elem = reflectValue.Index(int(db.RowsAffected))
    					if onConflictDonothing {
    						for _, field := range fields {
    							if _, ok := field.ValueOf(db.Statement.Context, elem); !ok {
    								db.RowsAffected++
    								goto BEGIN
    							}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 09:53:11 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  2. callbacks/associations.go

    					distinctElems := reflect.MakeSlice(reflect.SliceOf(fieldType), 0, 10)
    					identityMap := map[string]bool{}
    					for i := 0; i < rValLen; i++ {
    						obj := db.Statement.ReflectValue.Index(i)
    						if reflect.Indirect(obj).Kind() != reflect.Struct {
    							break
    						}
    						if _, zero := rel.Field.ValueOf(db.Statement.Context, obj); !zero { // check belongs to relation value
    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)
  3. migrator/migrator.go

    		}
    		results = append(results, clause.Expr{SQL: str})
    	}
    	return
    }
    
    // BuildIndexOptionsInterface build index options interface
    type BuildIndexOptionsInterface interface {
    	BuildIndexOptions([]schema.IndexOption, *gorm.Statement) []interface{}
    }
    
    // CreateIndex create index `name`
    func (m Migrator) CreateIndex(value interface{}, name string) error {
    	return m.RunWithValue(value, func(stmt *gorm.Statement) error {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  4. chainable_api.go

    // [docs] for more depth.
    //
    //	// add a simple limit clause
    //	db.Clauses(clause.Limit{Limit: 1}).Find(&User{})
    //	// tell the optimizer to use the `idx_user_name` index
    //	db.Clauses(hints.UseIndex("idx_user_name")).Find(&User{})
    //	// specify the lock strength to UPDATE
    //	db.Clauses(clause.Locking{Strength: "UPDATE"}).Find(&users)
    //
    // [docs]: https://gorm.io/docs/sql_builder.html#Clauses
    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)
  5. callbacks/create.go

    			switch db.Statement.ReflectValue.Kind() {
    			case reflect.Slice, reflect.Array:
    				if config.LastInsertIDReversed {
    					for i := db.Statement.ReflectValue.Len() - 1; i >= 0; i-- {
    						rv := db.Statement.ReflectValue.Index(i)
    						if reflect.Indirect(rv).Kind() != reflect.Struct {
    							break
    						}
    
    						_, isZero := pkField.ValueOf(db.Statement.Context, rv)
    						if isZero {
    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)
  6. tests/preload_suits_test.go

    			ID uint
    		}
    		Level3 struct {
    			ID       uint
    			Level4ID sql.NullInt64 `sql:"index"`
    			Level4   *Level4
    		}
    		Level2 struct {
    			ID      uint
    			Level3s []*Level3 `gorm:"many2many:level2_level3s"`
    		}
    		Level1 struct {
    			ID       uint
    			Level2ID sql.NullInt64 `sql:"index"`
    			Level2   *Level2
    		}
    	)
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Mar 18 05:38:46 GMT 2022
    - 30.3K bytes
    - Viewed (0)
  7. finisher_api.go

    			tx.AddError(ErrPrimaryKeyRequired)
    			break
    		}
    
    		primaryValue, zero := result.Statement.Schema.PrioritizedPrimaryField.ValueOf(tx.Statement.Context, resultsValue.Index(resultsValue.Len()-1))
    		if zero {
    			tx.AddError(ErrPrimaryKeyRequired)
    			break
    		}
    		queryDB = tx.Clauses(clause.Gt{Column: clause.Column{Table: clause.CurrentTable, Name: clause.PrimaryKey}, Value: primaryValue})
    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)
  8. 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)
  9. 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)
  10. 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)
Back to top