Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for name (0.22 sec)

  1. 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 Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  2. 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 Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  3. 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 Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 22 06:43:02 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  4. 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 Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 14.9K bytes
    - Viewed (0)
  5. 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 Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  6. 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 Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 49.8K bytes
    - Viewed (0)
  7. 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 Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 09:53:11 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  8. clause/where.go

    package clause
    
    import (
    	"strings"
    )
    
    const (
    	AndWithSpace = " AND "
    	OrWithSpace  = " OR "
    )
    
    // Where where clause
    type Where struct {
    	Exprs []Expression
    }
    
    // Name where clause name
    func (where Where) Name() string {
    	return "WHERE"
    }
    
    // Build build where clause
    func (where Where) Build(builder Builder) {
    	if len(where.Exprs) == 1 {
    		if andCondition, ok := where.Exprs[0].(AndConditions); ok {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 5.1K bytes
    - Viewed (0)
Back to top