Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 31 for related (0.18 sec)

  1. .github/labels.json

          "colour": "#43952A",
          "description": "feature request"
        },
        "invalid_question": {
          "name": "type:invalid question",
          "colour": "#CF2E1F",
          "description": "invalid question (not related to GORM or described in document or not enough information provided)"
        },
        "with_playground": {
          "name": "type:with reproduction steps",
          "colour": "#00ff00",
          "description": "with reproduction steps"
    Json
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Oct 19 03:49:03 GMT 2020
    - 3.8K bytes
    - Viewed (0)
  2. tests/upsert_test.go

    	}
    
    	if user1.Name != "find or create" || user1.ID == 0 || user1.Age != 33 {
    		t.Errorf("user should be created with search value")
    	}
    
    	DB.Where(&User{Name: "find or create", Age: 33}).FirstOrCreate(&user2)
    	if user1.ID != user2.ID || user2.Name != "find or create" || user2.ID == 0 || user2.Age != 33 {
    		t.Errorf("user should be created with search value")
    	}
    
    	DB.FirstOrCreate(&user3, map[string]interface{}{"name": "find or create 2"})
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Sep 05 07:39:19 GMT 2022
    - 11.4K bytes
    - Viewed (0)
  3. chainable_api.go

    // By default, GORM uses soft deletion, marking records as "deleted"
    // by setting a timestamp on a specific field (e.g., `deleted_at`).
    // Unscoped allows queries to include records marked as deleted,
    // overriding the soft deletion behavior.
    // Example:
    //    var users []User
    //    db.Unscoped().Find(&users)
    //    // Retrieves all users, including deleted ones.
    func (db *DB) Unscoped() (tx *DB) {
    	tx = db.getInstance()
    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)
  4. tests/hooks_test.go

    		t.Fatalf("After delete callbacks should be invoked successfully, %v", p.GetCallTimes())
    	}
    
    	if DB.Where("Code = ?", "unique_code").First(&p).Error == nil {
    		t.Fatalf("Can't find a deleted record")
    	}
    
    	beforeCallTimes := p.AfterFindCallTimes
    	if DB.Where("Code = ?", "unique_code").Find(&p).Error != nil {
    		t.Fatalf("Find don't raise error when record not found")
    	}
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Feb 18 01:20:29 GMT 2023
    - 15.9K bytes
    - Viewed (0)
  5. tests/table_test.go

    	}
    
    	userQueryCharacter := "SELECT .*u.*id.*u.*created_at.*u.*updated_at.*u.*deleted_at.*u.*name.*u.*age.*u.*birthday" +
    		".*u.*company_id.*u.*manager_id.*u.*active.* "
    
    	r = dryDB.Table("(?) as u", DB.Model(&User{}).Select("name")).Find(&User{}).Statement
    	if !regexp.MustCompile(userQueryCharacter + "FROM \\(SELECT .name. FROM .users. WHERE .users.\\..deleted_at. IS NULL\\) as u WHERE .u.\\..deleted_at. IS NULL").MatchString(r.Statement.SQL.String()) {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Mar 09 09:31:28 GMT 2024
    - 10.6K bytes
    - Viewed (0)
  6. tests/migrate_test.go

    		t.Fatalf("failed to migrate, got %v", err)
    	}
    
    	if !DB.Migrator().HasIndex(&UserWithUniqueIndex{}, "idx_name") {
    		t.Errorf("Failed to find created index")
    	}
    
    	if !DB.Migrator().HasIndex(&UserWithUniqueIndex{}, "idx_user_with_unique_indices_u_name") {
    		t.Errorf("Failed to find created index")
    	}
    
    	if err := DB.AutoMigrate(&UserWithUniqueIndex{}); err != nil {
    		t.Fatalf("failed to migrate, got %v", err)
    	}
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  7. logger/sql_test.go

    			NumericRegexp: nil,
    			Vars:          []interface{}{"jinzhu", 1, 999.99, true, []byte("12345"), tt, &tt, nil, "w@g.\"com", myrole, pwd},
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Mar 21 08:00:02 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  8. tests/customize_field_test.go

    	}
    
    	if DB.Migrator().HasColumn(&CustomizeFieldStruct{}, "FieldIgnore") {
    		t.Errorf("FieldIgnore should not be created")
    	}
    
    	if DB.Migrator().HasColumn(&CustomizeFieldStruct{}, "field_ignore") {
    		t.Errorf("FieldIgnore should not be created")
    	}
    
    	generateStruct := func(name string) *CustomizeFieldStruct {
    		return &CustomizeFieldStruct{
    			Name:             name,
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Sep 11 09:33:31 GMT 2020
    - 6.9K bytes
    - Viewed (0)
  9. tests/main_test.go

    		t.Errorf("Should got error with invalid SQL")
    	}
    
    	DB.Model(&User{}).Count(&count2)
    	if count1 != count2 {
    		t.Errorf("No user should not be deleted by invalid SQL")
    	}
    }
    
    func TestSetAndGet(t *testing.T) {
    	if value, ok := DB.Set("hello", "world").Get("hello"); !ok {
    		t.Errorf("Should be able to get setting after set")
    	} else if value.(string) != "world" {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Mar 24 01:31:58 GMT 2022
    - 1.4K bytes
    - Viewed (0)
  10. finisher_api.go

    	return tx.callbacks.Update().Execute(tx)
    }
    
    // Delete deletes value matching given conditions. If value contains primary key it is included in the conditions. If
    // value includes a deleted_at field, then Delete performs a soft delete instead by setting deleted_at with the current
    // time if null.
    func (db *DB) Delete(value interface{}, conds ...interface{}) (tx *DB) {
    	tx = db.getInstance()
    	if len(conds) > 0 {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 22.7K bytes
    - Viewed (0)
Back to top