Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for Chalin (0.2 sec)

  1. chainable_api.go

    	} else {
    		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 28 09:35:09 GMT 2024
    - Last Modified: Wed Apr 17 03:38:55 GMT 2024
    - 14.3K bytes
    - Viewed (1)
  2. tests/query_test.go

    	DB.Create(&address)
    
    	var result AddressByZipCode
    	DB.First(&result, "00501")
    
    	AssertEqual(t, result, address)
    }
    
    func TestSearchWithEmptyChain(t *testing.T) {
    	user := User{Name: "search_with_empty_chain", Age: 1}
    	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{}
    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)
Back to top