Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 138 for age (0.15 sec)

  1. tests/scan_test.go

    	doubleAgeRes := &result{}
    	if err := DB.Table("users").Select("age + age as age").Where("id = ?", user3.ID).Scan(&doubleAgeRes).Error; err != nil {
    		t.Errorf("Scan to pointer of pointer")
    	}
    
    	if doubleAgeRes.Age != int(res.Age)*2 {
    		t.Errorf("Scan double age as age, expect: %v, got %v", res.Age*2, doubleAgeRes.Age)
    	}
    
    	var results []result
    	DB.Table("users").Select("name, age").Where("id in ?", []uint{user2.ID, user3.ID}).Scan(&results)
    
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Sat May 28 14:18:07 GMT 2022
    - 8.2K bytes
    - Viewed (0)
  2. clause/where_test.go

    			}},
    			"SELECT * FROM `users` WHERE `age` = ? OR `name` <> ?",
    			[]interface{}{18, "jinzhu"},
    		},
    		{
    			[]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/update_test.go

    	if err := DB.Model(&results[1]).Clauses(clause.Returning{Columns: []clause.Column{{Name: "age"}}}).Updates(map[string]interface{}{"age": gorm.Expr("age + ?", 100)}).Error; err != nil {
    		t.Errorf("Not error should happen when updating with gorm expr, but got %v", err)
    	}
    
    	if results[1].Age-results[0].Age != 100 {
    		t.Errorf("failed to return updated age column")
    	}
    }
    
    func TestUpdateWithDiffSchema(t *testing.T) {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Dec 04 03:50:58 GMT 2023
    - 30.3K bytes
    - Viewed (0)
  4. tests/group_by_test.go

    	users := []User{{
    		Name:     "groupby",
    		Age:      10,
    		Birthday: Now(),
    		Active:   true,
    	}, {
    		Name:     "groupby",
    		Age:      20,
    		Birthday: Now(),
    	}, {
    		Name:     "groupby",
    		Age:      30,
    		Birthday: Now(),
    		Active:   true,
    	}, {
    		Name:     "groupby1",
    		Age:      110,
    		Birthday: Now(),
    	}, {
    		Name:     "groupby1",
    		Age:      220,
    		Birthday: Now(),
    		Active:   true,
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 3.3K bytes
    - Viewed (0)
  5. docs_src/python_types/tutorial003.py

    def get_name_with_age(name: str, age: int):
        name_with_age = name + " is this old: " + age
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 119 bytes
    - Viewed (0)
  6. logger/sql_test.go

    	}{
    		{
    			SQL:           "create table users (name, age, height, actived, bytes, create_at, update_at, deleted_at, email, role, pass) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
    			NumericRegexp: nil,
    			Vars:          []interface{}{"jinzhu", 1, 999.99, true, []byte("12345"), tt, &tt, nil, "w@g.\"com", myrole, pwd},
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Thu Mar 21 08:00:02 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  7. tensorflow/c/experimental/filesystem/plugins/gcs/expiring_lru_cache.h

    /// max item age (in seconds) and max entries.
    ///
    /// This class is thread safe.
    template <typename T>
    class ExpiringLRUCache {
     public:
      /// A `max_age` of 0 means that nothing is cached. A `max_entries` of 0 means
      /// that there is no limit on the number of entries in the cache (however, if
      /// `max_age` is also 0, the cache will not be populated).
    C
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Thu Jul 09 19:31:22 GMT 2020
    - 6.3K bytes
    - Viewed (0)
  8. tests/sql_builder_test.go

    	}
    
    	DB.Exec("update users set age=? where name = ?", gorm.Expr("age * ? + ?", 2, 10), "jinzhu-raw")
    
    	var age int
    	DB.Raw("select sum(age) from users where name = ?", "jinzhu-raw").Scan(&age)
    
    	if age != ((1+10+20)*2 + 30) {
    		t.Errorf("Invalid age, got %v", age)
    	}
    }
    
    func TestRowsWithGroup(t *testing.T) {
    	users := []User{
    		{Name: "having_user_1", Age: 1},
    		{Name: "having_user_2", Age: 10},
    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)
  9. okhttp/src/test/java/okhttp3/CookieTest.kt

          .isEqualTo(2000L)
        assertThat(parseCookie(0L, url, "a=b; Expires=Thu, 01 Jan 1970 00:00:01 GMT; Max-Age=2")!!.expiresAt)
          .isEqualTo(2000L)
      }
    
      /** If a cookie incorrectly defines multiple 'Max-Age' attributes, the last one defined wins.  */
      @Test fun lastMaxAgeWins() {
        assertThat(parseCookie(0L, url, "a=b; Max-Age=2; Max-Age=4; Max-Age=1; Max-Age=3")!!.expiresAt)
    Plain Text
    - Registered: Fri Apr 19 11:42:09 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 24.3K bytes
    - Viewed (0)
  10. tests/query_test.go

    func TestLimit(t *testing.T) {
    	users := []User{
    		{Name: "LimitUser1", Age: 1},
    		{Name: "LimitUser2", Age: 10},
    		{Name: "LimitUser3", Age: 20},
    		{Name: "LimitUser4", Age: 10},
    		{Name: "LimitUser5", Age: 20},
    		{Name: "LimitUser6", Age: 20},
    	}
    
    	DB.Create(&users)
    
    	var users1, users2, users3 []User
    	DB.Order("age desc").Limit(3).Find(&users1).Limit(5).Find(&users2).Limit(-1).Find(&users3)
    
    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)
Back to top