Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 34 for Lata (0.22 sec)

  1. callbacks/preload.go

    			case reflect.Struct:
    				tx.AddError(rel.Field.Set(tx.Statement.Context, data, elem.Interface()))
    			case reflect.Slice, reflect.Array:
    				if reflectFieldValue.Type().Elem().Kind() == reflect.Ptr {
    					tx.AddError(rel.Field.Set(tx.Statement.Context, data, reflect.Append(reflectFieldValue, elem).Interface()))
    				} else {
    					tx.AddError(rel.Field.Set(tx.Statement.Context, data, reflect.Append(reflectFieldValue, elem.Elem()).Interface()))
    				}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  2. tests/associations_belongs_to_test.go

    	}
    	AssertAssociationCount(t, user2, "Manager", 1, "after delete non-existing data")
    
    	if err := DB.Model(&user2).Association("Manager").Delete(manager2); err != nil {
    		t.Fatalf("Error happened when delete Manager, got %v", err)
    	}
    	AssertAssociationCount(t, user2, "Manager", 0, "after delete")
    
    	// Prepare Data for Clear
    	if err := DB.Model(&user2).Association("Company").Append(&company); err != nil {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 9.3K bytes
    - Viewed (0)
  3. tests/delete_test.go

    	if len(results) != 2 {
    		t.Errorf("failed to return delete data, got %v", results)
    	}
    
    	var count int64
    	DB.Model(&User{}).Where("name IN ?", []string{users[0].Name, users[1].Name, users[2].Name}).Count(&count)
    	if count != 1 {
    		t.Errorf("failed to delete data, current count %v", count)
    	}
    }
    
    func TestDeleteReturning(t *testing.T) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Oct 10 07:03:34 GMT 2023
    - 9.4K bytes
    - Viewed (0)
  4. schema/schema_test.go

    	if err != nil {
    		t.Fatalf("failed to parse pointer user, got error %v", err)
    	}
    
    	// check schema
    	checkSchema(t, user, schema.Schema{Name: "AdvancedDataTypeUser", Table: "advanced_data_type_users"}, []string{"ID"})
    
    	// check fields
    	fields := []schema.Field{
    		{Name: "ID", DBName: "id", BindNames: []string{"ID"}, DataType: schema.Int, PrimaryKey: true, Size: 64, HasDefaultValue: true, AutoIncrement: true},
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 12.9K bytes
    - Viewed (0)
  5. schema/field_test.go

    }
    
    func TestAdvancedDataTypeValuerAndSetter(t *testing.T) {
    	var (
    		userSchema, _ = schema.Parse(&AdvancedDataTypeUser{}, &sync.Map{}, schema.NamingStrategy{})
    		name          = "advanced_data_type_valuer_and_setter"
    		deletedAt     = mytime(time.Now())
    		isAdmin       = mybool(false)
    		user          = AdvancedDataTypeUser{
    			ID:           sql.NullInt64{Int64: 10, Valid: true},
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Feb 19 09:02:53 GMT 2022
    - 12.7K bytes
    - Viewed (0)
  6. schema/field.go

    			switch data := v.(type) {
    			case **int64:
    				if data != nil && *data != nil {
    					field.ReflectValueOf(ctx, value).SetInt(**data)
    				}
    			case **int:
    				if data != nil && *data != nil {
    					field.ReflectValueOf(ctx, value).SetInt(int64(**data))
    				}
    			case **int8:
    				if data != nil && *data != nil {
    					field.ReflectValueOf(ctx, value).SetInt(int64(**data))
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
  7. tests/default_value_test.go

    		t.Fatalf("Failed to find created data, got error: %v", err)
    	} else if result.Name != "foo" || result.Name2 != "foo" || result.Name3 != "" || result.Age != 18 || !result.Enabled || result.Created.Format("20060102") != "20000102" {
    		t.Fatalf("Failed to find created data with default data, got %+v", result)
    	}
    
    	type Harumph2 struct {
    		ID      int       `gorm:"default:0"`
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 08 03:29:55 GMT 2024
    - 2.3K bytes
    - Viewed (0)
  8. association.go

    			cleanUpDeletedRelations := func(data reflect.Value) {
    				if _, zero := rel.Field.ValueOf(association.DB.Statement.Context, data); !zero {
    					fieldValue := reflect.Indirect(rel.Field.ReflectValueOf(association.DB.Statement.Context, data))
    					primaryValues := make([]interface{}, len(rel.FieldSchema.PrimaryFields))
    
    					switch fieldValue.Kind() {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu May 04 11:30:45 GMT 2023
    - 21.2K bytes
    - Viewed (0)
  9. tests/associations_test.go

    )
    
    func AssertAssociationCount(t *testing.T, data interface{}, name string, result int64, reason string) {
    	if count := DB.Model(data).Association(name).Count(); count != result {
    		t.Fatalf("invalid %v count %v, expects: %v got %v", name, reason, result, count)
    	}
    
    	var newUser User
    	if user, ok := data.(User); ok {
    		DB.Find(&newUser, "id = ?", user.ID)
    	} else if user, ok := data.(*User); ok {
    		DB.Find(&newUser, "id = ?", user.ID)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Feb 08 08:29:09 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  10. tests/associations_many2many_test.go

    	}
    	AssertAssociationCount(t, user2, "Languages", 1, "after delete non-existing data")
    
    	if err := DB.Model(&user2).Association("Languages").Delete(&language2); err != nil {
    		t.Fatalf("Error happened when delete Languages, got %v", err)
    	}
    	AssertAssociationCount(t, user2, "Languages", 0, "after delete")
    
    	// Prepare Data for Clear
    	if err := DB.Model(&user2).Association("Languages").Append(&language); err != nil {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Jun 10 13:05:19 GMT 2023
    - 13.2K bytes
    - Viewed (0)
Back to top