Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 22 for init (0.21 sec)

  1. tests/update_test.go

    	sort.Slice(result.Pets, func(i, j int) bool {
    		return result.Pets[i].ID < result.Pets[j].ID
    	})
    	sort.Slice(result.Team, func(i, j int) bool {
    		return result.Team[i].ID < result.Team[j].ID
    	})
    	sort.Slice(result.Friends, func(i, j int) bool {
    		return result.Friends[i].ID < result.Friends[j].ID
    	})
    	sort.Slice(result2.Pets, func(i, j int) bool {
    		return result2.Pets[i].ID < result2.Pets[j].ID
    	})
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Dec 04 03:50:58 GMT 2023
    - 30.3K bytes
    - Viewed (0)
  2. tests/scanner_valuer_test.go

    	return time.Now() /* pass tests, mysql 8 doesn't support 0000-00-00 by default */, nil
    }
    
    type NullString struct {
    	sql.NullString
    }
    
    type Point struct {
    	X, Y int
    }
    
    func (point Point) GormDataType() string {
    	return "geo"
    }
    
    func (point Point) GormValue(ctx context.Context, db *gorm.DB) clause.Expr {
    	return clause.Expr{
    		SQL:  "ST_PointFromText(?)",
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Wed Jun 07 07:02:07 GMT 2023
    - 10.6K bytes
    - Viewed (0)
  3. schema/schema_test.go

    	type CorpBase struct {
    		gorm.Model
    		OwnerID string
    	}
    
    	type Company struct {
    		ID      int
    		OwnerID int
    		Name    string
    		Ignored string `gorm:"-"`
    	}
    
    	type Corp struct {
    		CorpBase
    		Base Company `gorm:"embedded;embeddedPrefix:company_"`
    	}
    
    	cropSchema, err := schema.Parse(&Corp{}, &sync.Map{}, schema.NamingStrategy{})
    	if err != nil {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 12.9K bytes
    - Viewed (0)
  4. schema/field_test.go

    		{Name: "INT", DBName: "fint", BindNames: []string{"INT"}, DataType: schema.Int, Creatable: true, Updatable: true, Readable: true, Size: 64, Tag: `gorm:"column:fint"`},
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Sat Feb 19 09:02:53 GMT 2022
    - 12.7K bytes
    - Viewed (0)
  5. tests/preload_test.go

    }
    
    func TestEmbedPreload(t *testing.T) {
    	type Country struct {
    		ID   int `gorm:"primaryKey"`
    		Name string
    	}
    	type EmbeddedAddress struct {
    		ID        int
    		Name      string
    		CountryID *int
    		Country   *Country
    	}
    	type NestedAddress struct {
    		EmbeddedAddress
    	}
    	type Org struct {
    		ID              int
    		PostalAddress   EmbeddedAddress `gorm:"embedded;embeddedPrefix:postal_address_"`
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 13.4K bytes
    - Viewed (0)
  6. tests/upsert_test.go

    	}
    
    	DB.Where(&User{Name: "find or init"}).Assign("age", 44).FirstOrInit(&user4)
    	if user4.Name != "find or init" || user4.ID != 0 || user4.Age != 44 {
    		t.Errorf("user should be initialized with search value and assign attrs")
    	}
    
    	DB.Save(&User{Name: "find or init", Age: 33})
    	DB.Where(&User{Name: "find or init"}).Attrs("age", 44).FirstOrInit(&user5)
    	if user5.Name != "find or init" || user5.ID == 0 || user5.Age != 33 {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Sep 05 07:39:19 GMT 2022
    - 11.4K bytes
    - Viewed (0)
  7. statement.go

    	Context              context.Context
    	RaiseErrorOnNotFound bool
    	SkipHooks            bool
    	SQL                  strings.Builder
    	Vars                 []interface{}
    	CurDestIndex         int
    	attrs                []interface{}
    	assigns              []interface{}
    	scopes               []func(*DB) *DB
    }
    
    type join struct {
    	Name     string
    	Conds    []interface{}
    	On       *clause.Where
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 19.8K bytes
    - Viewed (0)
  8. tests/multi_primary_keys_test.go

    func TestCompositePrimaryKeysAssociations(t *testing.T) {
    	type Label struct {
    		BookID *uint  `gorm:"primarykey"`
    		Name   string `gorm:"primarykey"`
    		Value  string
    	}
    
    	type Book struct {
    		ID     int
    		Name   string
    		Labels []Label
    	}
    
    	DB.Migrator().DropTable(&Label{}, &Book{})
    	if err := DB.AutoMigrate(&Label{}, &Book{}); err != nil {
    		t.Fatalf("failed to migrate, got %v", err)
    	}
    
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 12.8K bytes
    - Viewed (0)
  9. schema/relationship_test.go

    	type Toy struct {
    		ID        int
    		Name      string
    		OwnerID   int
    		OwnerType string
    	}
    	type User struct {
    		ID  int
    		Cat struct {
    			Name string
    			Toy  Toy   `gorm:"polymorphic:Owner;"`
    			Toys []Toy `gorm:"polymorphic:Owner;"`
    		} `gorm:"embedded;embeddedPrefix:cat_"`
    		Dog struct {
    			ID     int
    			Name   string
    			UserID int
    			Toy    Toy   `gorm:"polymorphic:Owner;"`
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 25.5K bytes
    - Viewed (0)
  10. scan.go

    					}
    				}
    			}
    
    			for initialized || rows.Next() {
    			BEGIN:
    				initialized = false
    
    				if update {
    					if int(db.RowsAffected) >= reflectValue.Len() {
    						return
    					}
    					elem = reflectValue.Index(int(db.RowsAffected))
    					if onConflictDonothing {
    						for _, field := range fields {
    							if _, ok := field.ValueOf(db.Statement.Context, elem); !ok {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Fri Mar 15 06:14:48 GMT 2024
    - 9.8K bytes
    - Viewed (0)
Back to top