Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for name (0.15 sec)

  1. schema/relationship_test.go

    	checkStructRelation(t, &User{}, Relation{
    		Name: "Profiles", Type: schema.Many2Many, Schema: "User", FieldSchema: "Profile",
    		JoinTable: JoinTable{Name: "user_profiles", Table: "user_profiles"},
    		References: []Reference{
    			{"Refer", "User", "UserReferID", "user_profiles", "", true},
    			{"UserRefer", "Profile", "ProfileRefer", "user_profiles", "", false},
    		},
    	}, Relation{
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 25.5K bytes
    - Viewed (0)
  2. scan.go

    						}
    					} else if names := utils.SplitNestedRelationName(column); len(names) > 1 { // has nested relation
    						if rel, ok := sch.Relationships.Relations[names[0]]; ok {
    							subNameCount := len(names)
    							// nested relation fields
    							relFields := make([]*schema.Field, 0, subNameCount-1)
    							relFields = append(relFields, rel.Field)
    							for _, name := range names[1 : subNameCount-1] {
    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)
  3. migrator/migrator.go

    		}
    
    		return fmt.Errorf("failed to create index with name %s", name)
    	})
    }
    
    // DropIndex drop index `name`
    func (m Migrator) DropIndex(value interface{}, name string) error {
    	return m.RunWithValue(value, func(stmt *gorm.Statement) error {
    		if stmt.Schema != nil {
    			if idx := stmt.Schema.LookIndex(name); idx != nil {
    				name = idx.Name
    			}
    		}
    
    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

    //
    //	// Find the first user with name jinzhu
    //	db.Where("name = ?", "jinzhu").First(&user)
    //	// Find the first user with name jinzhu and age 20
    //	db.Where(&User{Name: "jinzhu", Age: 20}).First(&user)
    //	// Find the first user with name jinzhu and age not equal to 20
    //	db.Where("name = ?", "jinzhu").Where("age <> ?", "20").First(&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)
  5. utils/utils.go

    // NestedRelationName nested relationships like `Manager__Company`
    func NestedRelationName(prefix, name string) string {
    	return prefix + nestedRelationSplit + name
    }
    
    // SplitNestedRelationName Split nested relationships to `[]string{"Manager","Company"}`
    func SplitNestedRelationName(name string) []string {
    	return strings.Split(name, nestedRelationSplit)
    }
    
    // JoinNestedRelationNames nested relationships like `Manager__Company`
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 22 06:43:02 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  6. clause/where_test.go

    			}, clause.Where{
    				Exprs: []clause.Expression{clause.Or(clause.Not(clause.Gt{Column: "score", Value: 100}), clause.Like{Column: "name", Value: "%linus%"})},
    			}},
    			"SELECT * FROM `users` WHERE (`users`.`id` <> ? AND `age` <= ?) OR `name` <> ? AND (`score` <= ? OR `name` LIKE ?)",
    			[]interface{}{"1", 18, "jinzhu", 100, "%linus%"},
    		},
    		{
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  7. tests/preload_test.go

    	org := Org{
    		PostalAddress:   EmbeddedAddress{Name: "a1", Country: &Country{Name: "c1"}},
    		VisitingAddress: EmbeddedAddress{Name: "a2", Country: &Country{Name: "c2"}},
    		Address:         &EmbeddedAddress{Name: "a3", Country: &Country{Name: "c3"}},
    		NestedAddress: NestedAddress{
    			EmbeddedAddress: EmbeddedAddress{Name: "a4", Country: &Country{Name: "c4"}},
    		},
    	}
    	if err := DB.Create(&org).Error; err != nil {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 14.9K bytes
    - Viewed (0)
  8. callbacks/preload.go

    	setPreloadMap := func(name, value string, args []interface{}) {
    		if _, ok := preloadMap[name]; !ok {
    			preloadMap[name] = map[string][]interface{}{}
    		}
    		if value != "" {
    			preloadMap[name][value] = args
    		}
    	}
    
    	for name, args := range preloads {
    		preloadFields := strings.Split(name, ".")
    		value := strings.TrimPrefix(strings.TrimPrefix(name, preloadFields[0]), ".")
    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. tests/query_test.go

    	if result.ID != 0 {
    		t.Errorf("Should not have ID because only selected name, %+v", result.ID)
    	}
    
    	if user.Name != result.Name {
    		t.Errorf("Should have user Name when selected it")
    	}
    
    	var result2 User
    	DB.Where("name = ?", user.Name).Select("name as name").Find(&result2)
    	if result2.ID != 0 {
    		t.Errorf("Should not have ID because only selected name, %+v", result2.ID)
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 49.8K bytes
    - Viewed (0)
  10. schema/relationship.go

    		})
    	}
    
    	for idx, relField := range refForeignFields {
    		joinFieldName := strings.Title(relation.FieldSchema.Name) + relField.Name
    
    		if _, ok := ownFieldsMap[joinFieldName]; ok {
    			if field.Name != relation.FieldSchema.Name {
    				joinFieldName = inflection.Singular(field.Name) + relField.Name
    			} else {
    				joinFieldName += "Reference"
    			}
    		}
    
    		if len(joinReferences) > idx {
    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