Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for 50 (0.11 sec)

  1. 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)
  2. clause/limit_test.go

    package clause_test
    
    import (
    	"fmt"
    	"testing"
    
    	"gorm.io/gorm/clause"
    )
    
    func TestLimit(t *testing.T) {
    	limit0 := 0
    	limit10 := 10
    	limit50 := 50
    	limitNeg10 := -10
    	results := []struct {
    		Clauses []clause.Interface
    		Result  string
    		Vars    []interface{}
    	}{
    		{
    			[]clause.Interface{clause.Select{}, clause.From{}, clause.Limit{
    				Limit:  &limit10,
    				Offset: 20,
    			}},
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Feb 06 02:54:40 GMT 2024
    - 2.3K bytes
    - Viewed (0)
  3. tests/update_test.go

    	}
    
    	if users[1].Age != 19 {
    		t.Errorf("user 2's name should be updated, but got %v", users[1].Age)
    	}
    
    	DB.Model(users[1]).UpdateColumn("age", gorm.Expr("age + 100 - 50"))
    	var user3 User
    	DB.First(&user3, users[1].ID)
    
    	users[1].Age += 50
    	CheckUser(t, user3, *users[1])
    
    	// update with struct
    	DB.Model(users[1]).UpdateColumns(User{Name: "update_column_02_newnew2", Age: 200})
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Dec 04 03:50:58 GMT 2023
    - 30.3K bytes
    - Viewed (0)
  4. tests/migrate_test.go

    		}
    	)
    	checkField(&UniqueStruct3{}, "name", true, "")
    	checkField(&UniqueStruct4{}, "name", true, "")
    
    	type ( // uniqueIndex
    		UniqueStruct5 struct {
    			Name string `gorm:"size:50;uniqueIndex"`
    		}
    		UniqueStruct6 struct {
    			Name string `gorm:"size:60;uniqueIndex"`
    		}
    		UniqueStruct7 struct {
    			Name     string `gorm:"size:70;uniqueIndex:idx_us6_all_names"`
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  5. tests/associations_belongs_to_test.go

    }
    
    func TestBelongsToAssociationUnscoped(t *testing.T) {
    	type ItemParent struct {
    		gorm.Model
    		Logo string `gorm:"not null;type:varchar(50)"`
    	}
    	type ItemChild struct {
    		gorm.Model
    		Name         string `gorm:"type:varchar(50)"`
    		ItemParentID uint
    		ItemParent   ItemParent
    	}
    
    	tx := DB.Session(&gorm.Session{})
    	tx.Migrator().DropTable(&ItemParent{}, &ItemChild{})
    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)
  6. tests/sql_builder_test.go

    	// update
    	sql = DB.ToSQL(func(tx *gorm.DB) *gorm.DB {
    		return tx.Model(&User{}).Where("id = ?", 100).Update("name", "Foo bar")
    	})
    	assertEqualSQL(t, `UPDATE "users" SET "name"='Foo bar',"updated_at"='2021-10-18 19:50:09.438' WHERE id = 100 AND "users"."deleted_at" IS NULL`, sql)
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 16.7K bytes
    - Viewed (0)
Back to top