Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 34 for Lata (0.12 sec)

  1. tests/create_test.go

    	}
    }
    
    func TestCreateEmptySlice(t *testing.T) {
    	data := []User{}
    	if err := DB.Create(&data).Error; err != gorm.ErrEmptySlice {
    		t.Errorf("no data should be created, got %v", err)
    	}
    
    	sliceMap := []map[string]interface{}{}
    	if err := DB.Model(&User{}).Create(&sliceMap).Error; err != gorm.ErrEmptySlice {
    		t.Errorf("no data should be created, got %v", err)
    	}
    }
    
    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)
  2. tests/associations_has_many_test.go

    	}
    	AssertAssociationCount(t, user2, "Pets", 1, "after delete non-existing data")
    
    	if err := DB.Model(&user2).Association("Pets").Delete(&pet2); err != nil {
    		t.Fatalf("Error happened when delete Pets, got %v", err)
    	}
    	AssertAssociationCount(t, user2, "Pets", 0, "after delete")
    
    	// Prepare Data for Clear
    	if err := DB.Model(&user2).Association("Pets").Append(&pet); err != nil {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:36:08 GMT 2023
    - 15.6K bytes
    - Viewed (0)
  3. scan.go

    				f := joinFields[idx][len(joinFields[idx])-1]
    				db.AddError(f.Set(db.Statement.Context, relValue, values[idx]))
    			}
    		}
    
    		// release data to pool
    		field.NewValuePool.Put(values[idx])
    	}
    }
    
    // ScanMode scan data mode
    type ScanMode uint8
    
    // scan modes
    const (
    	ScanInitialized         ScanMode = 1 << 0 // 1
    	ScanUpdate              ScanMode = 1 << 1 // 2
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 09:53:11 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  4. schema/relationship_test.go

    package schema_test
    
    import (
    	"sync"
    	"testing"
    
    	"gorm.io/gorm"
    	"gorm.io/gorm/schema"
    )
    
    func checkStructRelation(t *testing.T, data interface{}, relations ...Relation) {
    	if s, err := schema.Parse(data, &sync.Map{}, schema.NamingStrategy{}); err != nil {
    		t.Errorf("Failed to parse schema, got error %v", err)
    	} else {
    		for _, rel := range relations {
    			checkSchemaRelation(t, s, rel)
    		}
    	}
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 25.5K bytes
    - Viewed (0)
  5. tests/postgres_test.go

    	}
    
    	harumph := Harumph{}
    	if err := DB.Create(&harumph).Error; err == nil {
    		t.Fatalf("should failed to create data, name can't be blank")
    	}
    
    	harumph = Harumph{Name: "jinzhu"}
    	if err := DB.Create(&harumph).Error; err != nil {
    		t.Fatalf("should be able to create data, but got %v", err)
    	}
    
    	var result Harumph
    	if err := DB.First(&result, "id = ?", harumph.ID).Error; err != nil || harumph.Name != "jinzhu" {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Oct 08 09:16:32 GMT 2022
    - 6.4K bytes
    - Viewed (3)
  6. tests/callbacks_test.go

    				err = e
    			}
    		}
    
    		if len(data.err) > 0 && err == nil {
    			t.Errorf("callbacks tests #%v should got error %v, but not", idx+1, data.err)
    		} else if len(data.err) == 0 && err != nil {
    			t.Errorf("callbacks tests #%v should not got error, but got %v", idx+1, err)
    		}
    
    		if ok, msg := assertCallbacks(callbacks.Create(), data.results); !ok {
    			t.Errorf("callbacks tests #%v failed, got %v", idx+1, msg)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 26 03:33:36 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  7. tests/hooks_test.go

    	if product.Price != 150 || product.Code != "L1212" {
    		t.Errorf("invalid data after update, got %+v", product)
    	}
    
    	// Code not changed, price should not change
    	DB.Model(&product).Updates(map[string]interface{}{"Name": "Product New"})
    
    	if product.Name != "Product New" || product.Price != 160 || product.Code != "L1212" {
    		t.Errorf("invalid data after update, got %+v", product)
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Feb 18 01:20:29 GMT 2023
    - 15.9K bytes
    - Viewed (0)
  8. migrator/migrator.go

    	sql, _ := fc()
    	fmt.Println(sql + ";")
    	l.Interface.Trace(ctx, begin, fc, err)
    }
    
    // GormDataTypeInterface gorm data type interface
    type GormDataTypeInterface interface {
    	GormDBDataType(*gorm.DB, *schema.Field) string
    }
    
    // RunWithValue run migration with statement value
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  9. logger/logger.go

    func (l *logger) Info(ctx context.Context, msg string, data ...interface{}) {
    	if l.LogLevel >= Info {
    		l.Printf(l.infoStr+msg, append([]interface{}{utils.FileWithLineNum()}, data...)...)
    	}
    }
    
    // Warn print warn messages
    func (l *logger) Warn(ctx context.Context, msg string, data ...interface{}) {
    	if l.LogLevel >= Warn {
    		l.Printf(l.warnStr+msg, append([]interface{}{utils.FileWithLineNum()}, data...)...)
    	}
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Nov 07 02:19:41 GMT 2023
    - 5.8K bytes
    - Viewed (0)
  10. errors.go

    	// ErrSubQueryRequired sub query required
    	ErrSubQueryRequired = errors.New("sub query required")
    	// ErrInvalidData unsupported data
    	ErrInvalidData = errors.New("unsupported data")
    	// ErrUnsupportedDriver unsupported driver
    	ErrUnsupportedDriver = errors.New("unsupported driver")
    	// ErrRegistered registered
    	ErrRegistered = errors.New("registered")
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 02:53:17 GMT 2024
    - 2.5K bytes
    - Viewed (0)
Back to top