Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 17 for LIKE (7.61 sec)

  1. clause/expression.go

    	Gt(lte).Build(builder)
    }
    
    // Like whether string matches regular expression
    type Like Eq
    
    func (like Like) Build(builder Builder) {
    	builder.WriteQuoted(like.Column)
    	builder.WriteString(" LIKE ")
    	builder.AddVar(builder, like.Value)
    }
    
    func (like Like) NegationBuild(builder Builder) {
    	builder.WriteQuoted(like.Column)
    	builder.WriteString(" NOT LIKE ")
    	builder.AddVar(builder, like.Value)
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Oct 10 06:45:48 GMT 2023
    - 8.3K bytes
    - Viewed (0)
  2. tests/distinct_test.go

    		t.Fatalf("errors happened when create users: %v", err)
    	}
    
    	var names []string
    	DB.Table("users").Where("name like ?", "distinct%").Order("name").Pluck("name", &names)
    	AssertEqual(t, names, []string{"distinct", "distinct", "distinct", "distinct-2", "distinct-3"})
    
    	var names1 []string
    	DB.Model(&User{}).Where("name like ?", "distinct%").Distinct().Order("name").Pluck("Name", &names1)
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 2.5K bytes
    - Viewed (0)
  3. callbacks.go

    			if errors.Is(err, schema.ErrUnsupportedDataType) && stmt.Table == "" && stmt.TableExpr == nil {
    				db.AddError(fmt.Errorf("%w: Table not set, please set it like: db.Model(&user) or db.Table(\"users\")", err))
    			} else {
    				db.AddError(err)
    			}
    		}
    	}
    
    	// assign stmt.ReflectValue
    	if stmt.Dest != nil {
    		stmt.ReflectValue = reflect.ValueOf(stmt.Dest)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 26 03:33:36 GMT 2024
    - 8.6K bytes
    - Viewed (1)
  4. utils/utils.go

    		return strconv.FormatUint(uint64(v), 10)
    	case uint64:
    		return strconv.FormatUint(v, 10)
    	}
    	return ""
    }
    
    const nestedRelationSplit = "__"
    
    // NestedRelationName nested relationships like `Manager__Company`
    func NestedRelationName(prefix, name string) string {
    	return prefix + nestedRelationSplit + name
    }
    
    // SplitNestedRelationName Split nested relationships to `[]string{"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)
  5. callbacks/query.go

    					relation, ok := db.Statement.Schema.Relationships.Relations[join.Name]
    					if ok {
    						isRelations = true
    						relations = append(relations, relation)
    					} else {
    						// handle nested join like "Manager.Company"
    						nestedJoinNames := strings.Split(join.Name, ".")
    						if len(nestedJoinNames) > 1 {
    							isNestedJoin := true
    							gussNestedRelations := make([]*schema.Relationship, 0, len(nestedJoinNames))
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Jan 29 03:34:57 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  6. clause/benchmarks_test.go

    				clause.Gt{Column: "age", Value: 18},
    				clause.Or(clause.Neq{Column: "name", Value: "jinzhu"}),
    			}},
    			clause.Where{Exprs: []clause.Expression{
    				clause.Or(clause.Gt{Column: "score", Value: 100}, clause.Like{Column: "name", Value: "%linus%"}),
    			}},
    			clause.GroupBy{Columns: []clause.Column{{Name: "role"}}, Having: []clause.Expression{clause.Eq{"role", "admin"}}},
    			clause.Limit{Limit: &limit10, Offset: 20},
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Oct 07 12:14:14 GMT 2022
    - 1.9K bytes
    - Viewed (0)
  7. chainable_api.go

    package gorm
    
    import (
    	"fmt"
    	"regexp"
    	"strings"
    
    	"gorm.io/gorm/clause"
    	"gorm.io/gorm/utils"
    )
    
    // Model specify the model you would like to run db operations
    //
    //	// update all users's name to `hello`
    //	db.Model(&User{}).Update("name", "hello")
    //	// if user's primary key is non-blank, will use it as condition, then will only update that user's name to `hello`
    //	db.Model(&user).Update("name", "hello")
    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)
  8. tests/group_by_test.go

    	}
    
    	if name != "groupby" || total != 60 {
    		t.Errorf("name should be groupby, but got %v, total should be 60, but got %v", name, total)
    	}
    
    	if err := DB.Model(&User{}).Select("name, sum(age) as total").Where("name LIKE ?", "groupby%").Group("name").Having("name = ?", "groupby1").Row().Scan(&name, &total); err != nil {
    		t.Errorf("no error should happen, but got %v", err)
    	}
    
    	if name != "groupby1" || total != 660 {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 3.3K bytes
    - Viewed (0)
  9. tests/upsert_test.go

    	if err := DB.Find(&langs2, "code LIKE ?", "upsert-slice%").Error; err != nil {
    		t.Errorf("no error should happen when find languages with code, but got %v", err)
    	} else if len(langs2) != 3 {
    		t.Errorf("should only find only 3 languages, but got %+v", langs2)
    	}
    
    	DB.Clauses(clause.OnConflict{DoNothing: true}).Create(&langs)
    	var langs3 []Language
    	if err := DB.Find(&langs3, "code LIKE ?", "upsert-slice%").Error; err != nil {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Sep 05 07:39:19 GMT 2022
    - 11.4K bytes
    - Viewed (0)
  10. schema/naming.go

    	RelationshipFKName(Relationship) string
    	CheckerName(table, column string) string
    	IndexName(table, column string) string
    	UniqueName(table, column string) string
    }
    
    // Replacer replacer interface like strings.Replacer
    type Replacer interface {
    	Replace(name string) string
    }
    
    var _ Namer = (*NamingStrategy)(nil)
    
    // NamingStrategy tables, columns naming strategy
    type NamingStrategy struct {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 5.2K bytes
    - Viewed (0)
Back to top