Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 29 for KSession (0.18 sec)

  1. callbacks/associations.go

    					}
    
    					for i := 0; i < elemLen; i++ {
    						appendToJoins(objs[i], elems.Index(i))
    					}
    				}
    
    				if joins.Len() > 0 {
    					db.AddError(db.Session(&gorm.Session{NewDB: true}).Clauses(clause.OnConflict{DoNothing: true}).Session(&gorm.Session{
    						SkipHooks:                db.Statement.SkipHooks,
    						DisableNestedTransaction: true,
    					}).Create(joins.Interface()).Error)
    				}
    			}
    		}
    	}
    }
    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)
  2. migrator/migrator.go

    		}
    	}
    
    	return
    }
    
    func (m Migrator) GetQueryAndExecTx() (queryTx, execTx *gorm.DB) {
    	queryTx = m.DB.Session(&gorm.Session{})
    	execTx = queryTx
    	if m.DB.DryRun {
    		queryTx.DryRun = false
    		execTx = m.DB.Session(&gorm.Session{Logger: &printSQLLogger{Interface: m.DB.Logger}})
    	}
    	return queryTx, execTx
    }
    
    // AutoMigrate auto migrate values
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  3. tests/hooks_test.go

    	}
    
    	DB.Model(&product).Session(&gorm.Session{SkipHooks: true}).Updates(Product3{Code: "L1216"})
    	if product.Price != 320 || product.Code != "L1216" {
    		t.Errorf("invalid data after update, got %+v", product)
    	}
    
    	var result2 Product3
    	DB.First(&result2, product.ID)
    
    	AssertEqual(t, result2, product)
    
    	product2 := Product3{Name: "Product", Price: 0}
    	DB.Session(&gorm.Session{SkipHooks: true}).Create(&product2)
    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)
  4. tests/upsert_test.go

    	}
    
    	if name := DB.Dialector.Name(); name != "sqlserver" {
    		type RestrictedLanguage struct {
    			Code string `gorm:"primarykey"`
    			Name string
    			Lang string `gorm:"<-:create"`
    		}
    
    		r := DB.Session(&gorm.Session{DryRun: true}).Clauses(clause.OnConflict{UpdateAll: true}).Create(&RestrictedLanguage{Code: "upsert_code", Name: "upsert_name", Lang: "upsert_lang"})
    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)
  5. cmd/sts-datatypes.go

    	// in Using IAM.
    	//
    	// Arn is a required field
    	Arn string
    
    	// A unique identifier that contains the role ID and the role session name of
    	// the role that is being assumed. The role ID is generated by AWS when the
    	// role is created.
    	//
    	// AssumedRoleId is a required field
    	AssumedRoleID string `xml:"AssumeRoleId"`
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri May 27 00:58:09 GMT 2022
    - 9.9K bytes
    - Viewed (0)
  6. tests/create_test.go

    		*GetUser("create_with_default_batch_sizs_6", Config{Account: true, Pets: 4, Toys: 3, Company: false, Manager: true, Team: 1, Languages: 3, Friends: 0}),
    	}
    
    	result := DB.Session(&gorm.Session{CreateBatchSize: 2}).Create(&users)
    	if result.RowsAffected != int64(len(users)) {
    		t.Errorf("affected rows should be %v, but got %v", len(users), result.RowsAffected)
    	}
    
    	for _, user := range users {
    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)
  7. tests/joins_test.go

    	if len(users6) != 1 {
    		t.Errorf("should find one users using left join with conditions, but got %v", len(users6))
    	}
    
    	dryDB := DB.Session(&gorm.Session{DryRun: true})
    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)
  8. tests/associations_has_many_test.go

    	}
    	type Item struct {
    		gorm.Model
    		Logo     string        `gorm:"not null;type:varchar(50)"`
    		Contents []ItemContent `gorm:"foreignKey:ItemID"`
    	}
    
    	tx := DB.Session(&gorm.Session{})
    	tx.Migrator().DropTable(&ItemContent{}, &Item{})
    	tx.AutoMigrate(&ItemContent{}, &Item{})
    
    	item := Item{
    		Logo: "logo",
    		Contents: []ItemContent{
    			{Name: "name", LanguageCode: "en"},
    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)
  9. finisher_api.go

    		if !selectedUpdate {
    			tx.Statement.Selects = append(tx.Statement.Selects, "*")
    		}
    
    		updateTx := tx.callbacks.Update().Execute(tx.Session(&Session{Initialized: true}))
    
    		if updateTx.Error == nil && updateTx.RowsAffected == 0 && !updateTx.DryRun && !selectedUpdate {
    			return tx.Session(&Session{SkipHooks: true}).Clauses(clause.OnConflict{UpdateAll: true}).Create(value)
    		}
    
    		return updateTx
    	}
    
    	return
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 22.7K bytes
    - Viewed (0)
  10. tests/table_test.go

    )
    
    type UserWithTable struct {
    	gorm.Model
    	Name string
    }
    
    func (UserWithTable) TableName() string {
    	return "gorm.user"
    }
    
    func TestTable(t *testing.T) {
    	dryDB := DB.Session(&gorm.Session{DryRun: true})
    
    	r := dryDB.Table("`user`").Find(&User{}).Statement
    	if !regexp.MustCompile("SELECT \\* FROM `user`").MatchString(r.Statement.SQL.String()) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Mar 09 09:31:28 GMT 2024
    - 10.6K bytes
    - Viewed (0)
Back to top