Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 26 for Turing (0.14 sec)

  1. schema/relationship_test.go

    func TestMany2ManyWithMultiPrimaryKeys(t *testing.T) {
    	type Tag struct {
    		ID     uint   `gorm:"primary_key"`
    		Locale string `gorm:"primary_key"`
    		Value  string
    	}
    
    	type Blog struct {
    		ID         uint   `gorm:"primary_key"`
    		Locale     string `gorm:"primary_key"`
    		Subject    string
    		Body       string
    		Tags       []Tag `gorm:"many2many:blog_tags;"`
    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)
  2. scan.go

    	switch dest := db.Statement.Dest.(type) {
    	case map[string]interface{}, *map[string]interface{}:
    		if initialized || rows.Next() {
    			columnTypes, _ := rows.ColumnTypes()
    			prepareValues(values, db, columnTypes, columns)
    
    			db.RowsAffected++
    			db.AddError(rows.Scan(values...))
    
    			mapValue, ok := dest.(map[string]interface{})
    			if !ok {
    				if v, ok := dest.(*map[string]interface{}); ok {
    					if *v == nil {
    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)
  3. tests/create_test.go

    	}
    }
    
    func TestCreateOnConflictWithDefaultNull(t *testing.T) {
    	type OnConflictUser struct {
    		ID     string
    		Name   string `gorm:"default:null"`
    		Email  string
    		Mobile string `gorm:"default:'133xxxx'"`
    	}
    
    	err := DB.Migrator().DropTable(&OnConflictUser{})
    	AssertEqual(t, err, nil)
    	err = DB.AutoMigrate(&OnConflictUser{})
    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)
  4. tests/joins_test.go

    	if !regexp.MustCompile("SELECT .* FROM .users. left join pets.*join accounts.*").MatchString(stmt.SQL.String()) {
    		t.Errorf("joins should be ordered, but got %v", stmt.SQL.String())
    	}
    
    	iv := DB.Table(`table_invoices`).Select(`seller, SUM(total) as total, SUM(paid) as paid, SUM(balance) as balance`).Group(`seller`)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Apr 26 14:19:32 GMT 2023
    - 13.5K bytes
    - Viewed (1)
  5. tests/associations_has_many_test.go

    	type ItemContent struct {
    		gorm.Model
    		ItemID       uint   `gorm:"not null"`
    		Name         string `gorm:"not null;type:varchar(50)"`
    		LanguageCode string `gorm:"not null;type:varchar(2)"`
    	}
    	type Item struct {
    		gorm.Model
    		Logo     string        `gorm:"not null;type:varchar(50)"`
    		Contents []ItemContent `gorm:"foreignKey:ItemID"`
    	}
    
    	tx := DB.Session(&gorm.Session{})
    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)
  6. migrator/migrator.go

    		*gorm.Statement
    		Depends []*schema.Schema
    	}
    
    	var (
    		modelNames, orderedModelNames []string
    		orderedModelNamesMap          = map[string]bool{}
    		parsedSchemas                 = map[*schema.Schema]bool{}
    		valuesMap                     = map[string]Dependency{}
    		insertIntoOrderedList         func(name string)
    		parseDependence               func(value interface{}, addToList bool)
    	)
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  7. chainable_api.go

    //
    // Use Select when you only want a subset of the fields. By default, GORM will select all fields.
    // Select accepts both string arguments and arrays.
    //
    //	// Select name and age of user using multiple arguments
    //	db.Select("name", "age").Find(&users)
    //	// Select name and age of user using an array
    //	db.Select([]string{"name", "age"}).Find(&users)
    func (db *DB) Select(query interface{}, args ...interface{}) (tx *DB) {
    	tx = db.getInstance()
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Apr 17 03:38:55 GMT 2024
    - 14.3K bytes
    - Viewed (1)
  8. tests/hooks_test.go

    		}
    	}
    }
    
    type Product4 struct {
    	gorm.Model
    	Name  string
    	Code  string
    	Price int64
    	Owner string
    	Item  ProductItem
    }
    
    type ProductItem struct {
    	gorm.Model
    	Code               string
    	Product4ID         uint
    	AfterFindCallTimes int
    }
    
    func (pi ProductItem) BeforeCreate(*gorm.DB) error {
    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)
  9. callbacks/associations.go

    	return
    }
    
    func saveAssociations(db *gorm.DB, rel *schema.Relationship, rValues reflect.Value, selectColumns map[string]bool, restricted bool, defaultUpdatingColumns []string) error {
    	// stop save association loop
    	if checkAssociationsSaved(db, rValues) {
    		return nil
    	}
    
    	var (
    		selects, omits []string
    		onConflict     = onConflictOption(db.Statement, rel.FieldSchema, defaultUpdatingColumns)
    		refName        = rel.Name + "."
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Apr 11 03:06:13 GMT 2023
    - 14.3K bytes
    - Viewed (0)
  10. tests/upsert_test.go

    		t.Fatalf("failed to upsert, got name %v", result.Name)
    	}
    
    	if name := DB.Dialector.Name(); name != "sqlserver" {
    		type RestrictedLanguage struct {
    			Code string `gorm:"primarykey"`
    			Name string
    			Lang string `gorm:"<-:create"`
    		}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Sep 05 07:39:19 GMT 2022
    - 11.4K bytes
    - Viewed (0)
Back to top