Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for exists (0.16 sec)

  1. tests/create_test.go

    	CheckUser(t, result2, user2)
    }
    
    func TestFirstOrCreateNotExistsTable(t *testing.T) {
    	company := Company{Name: "first_or_create_if_not_exists_table"}
    	if err := DB.Table("not_exists").FirstOrCreate(&company).Error; err == nil {
    		t.Errorf("not exists table, but err is nil")
    	}
    }
    
    func TestFirstOrCreateWithPrimaryKey(t *testing.T) {
    	company := Company{ID: 100, Name: "company100_with_primarykey"}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 26.4K bytes
    - Viewed (0)
Back to top