Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 438 for WHERE (0.17 sec)

  1. clause/where.go

    	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 {
    			where.Exprs = andCondition.Exprs
    		}
    	}
    
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Tue Mar 05 02:23:51 GMT 2024
    - 5K bytes
    - Viewed (0)
  2. clause/where_test.go

    				Exprs: []clause.Expression{clause.Or(clause.Neq{Column: "name", Value: "jinzhu"}), clause.Eq{Column: clause.PrimaryColumn, Value: "1"}, clause.Gt{Column: "age", Value: 18}},
    			}},
    			"SELECT * FROM `users` WHERE `users`.`id` = ? OR `name` <> ? AND `age` > ?",
    			[]interface{}{"1", "jinzhu", 18},
    		},
    		{
    			[]clause.Interface{clause.Select{}, clause.From{}, clause.Where{
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Tue Mar 05 02:23:51 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  3. tests/count_test.go

    	})
    
    	var count1 int64
    	if err := DB.Model(&Company{}).Where("name = ?", "company_count_group_a").Group("name").Count(&count1).Error; err != nil {
    		t.Errorf(fmt.Sprintf("Count should work, but got err %v", err))
    	}
    	if count1 != 1 {
    		t.Errorf("Count with group should be 1, but got count: %v", count1)
    	}
    
    	var count2 int64
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 6.9K bytes
    - Viewed (0)
  4. tests/scopes_test.go

    				return tx.Scopes(
    					func(d *gorm.DB) *gorm.DB { return d.Where("a = 1") },
    					func(d *gorm.DB) *gorm.DB {
    						return d.Where(DB.Or("b = 2").Or("c = 3"))
    					},
    				).Find(&Language{})
    			},
    			expected: `SELECT * FROM "languages" WHERE a = 1 AND (b = 2 OR c = 3)`,
    		}, {
    			name: "depth_1_pre_cond",
    			queryFn: func(tx *gorm.DB) *gorm.DB {
    				return tx.Where("z = 0").Scopes(
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 3.3K bytes
    - Viewed (0)
  5. tests/sql_builder_test.go

    		Size string
    	}
    	dryRunDB := DB.Session(&gorm.Session{DryRun: true})
    
    	stmt := dryRunDB.Where(
    		DB.Where("pizza = ?", "pepperoni").Where(DB.Where("size = ?", "small").Or("size = ?", "medium")),
    	).Or(
    		DB.Where("pizza = ?", "hawaiian").Where("size = ?", "xlarge"),
    	).Find(&Pizza{}).Statement
    
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 16.7K bytes
    - Viewed (0)
  6. chainable_api.go

    		tx.Statement.Omits = columns
    	}
    	return
    }
    
    // Where add conditions
    //
    // See the [docs] for details on the various formats that where clauses can take. By default, where clauses chain with AND.
    //
    //	// 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)
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Wed Apr 17 03:38:55 GMT 2024
    - 14.3K bytes
    - Viewed (1)
  7. tests/table_test.go

    		t.Errorf("Table with escape character, got %v", r.Statement.SQL.String())
    	}
    
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Sat Mar 09 09:31:28 GMT 2024
    - 10.6K bytes
    - Viewed (0)
  8. tests/query_test.go

    	DB.Create(&user)
    
    	var result User
    	if DB.Where("").Where("").First(&result).Error != nil {
    		t.Errorf("Should not raise any error if searching with empty strings")
    	}
    
    	result = User{}
    	if DB.Where(&User{}).Where("name = ?", user.Name).First(&result).Error != nil {
    		t.Errorf("Should not raise any error if searching with empty struct")
    	}
    
    	result = User{}
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Fri Mar 15 06:14:48 GMT 2024
    - 49.4K bytes
    - Viewed (0)
  9. internal/s3select/sql/parser_test.go

    	cases := []string{
    		`select * from s3object where Name like 'abcd'`,
    		`select Name like 'abc' from s3object`,
    		`select * from s3object where Name not like 'abc'`,
    		`select * from s3object where Name like 'abc' escape 't'`,
    		`select * from s3object where Name like 'a\%' escape '?'`,
    		`select * from s3object where Name not like 'abc\' escape '?'`,
    		`select * from s3object where Name like 'a\%' escape LOWER('?')`,
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 9.2K bytes
    - Viewed (0)
  10. internal/s3select/select_test.go

    			query: `SELECT id from s3object s WHERE s.id <= 9223372036854775807`,
    			wantResult: `{"id":0}
    {"id":1}
    {"id":2}
    {"id":3}`,
    		},
    		{
    			name:  "bignum-2",
    			query: `SELECT id from s3object s WHERE s.id >= -9223372036854775808`,
    			wantResult: `{"id":0}
    {"id":1}
    {"id":2}
    {"id":3}`,
    		},
    		{
    			name:       "donatello-3",
    			query:      `SELECT * from s3object s WHERE 'value' IN s.synonyms[*]`,
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sat Dec 23 07:19:11 GMT 2023
    - 76.2K bytes
    - Viewed (0)
Back to top