Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 38 for Ressin (0.19 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 Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Apr 11 03:06:13 GMT 2023
    - 14.3K bytes
    - Viewed (0)
  2. tests/scopes_test.go

    	}
    
    	db := DB.Scopes(func(tx *gorm.DB) *gorm.DB {
    		return tx.Table("custom_table")
    	}).Session(&gorm.Session{})
    
    	db.AutoMigrate(&User{})
    	if db.Find(&User{}).Statement.Table != "custom_table" {
    		t.Errorf("failed to call Scopes")
    	}
    
    	result := DB.Scopes(NameIn1And2, func(tx *gorm.DB) *gorm.DB {
    		return tx.Session(&gorm.Session{})
    	}).Find(&users1)
    
    	if result.RowsAffected != 2 {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 3.3K bytes
    - Viewed (0)
  3. 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 Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  4. tests/distinct_test.go

    		t.Errorf("failed to query users count, got error: %v, count %v", err, count)
    	}
    
    	dryDB := DB.Session(&gorm.Session{DryRun: true})
    	r := dryDB.Distinct("u.id, u.*").Table("user_speaks as s").Joins("inner join users as u on u.id = s.user_id").Where("s.language_code ='US' or s.language_code ='ES'").Find(&User{})
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 2.5K bytes
    - Viewed (0)
  5. 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 Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Feb 18 01:20:29 GMT 2023
    - 15.9K bytes
    - Viewed (0)
  6. 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 Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Sep 05 07:39:19 GMT 2022
    - 11.4K bytes
    - Viewed (0)
  7. tests/update_belongs_to_test.go

    	CheckUser(t, user2, user3)
    
    	if err := DB.Session(&gorm.Session{FullSaveAssociations: true}).Save(&user).Error; err != nil {
    		t.Fatalf("errors happened when update: %v", err)
    	}
    
    	var user4 User
    	DB.Preload("Company").Preload("Manager").Find(&user4, "id = ?", user.ID)
    	CheckUser(t, user4, user)
    
    	user.Company.Name += "new2"
    	user.Manager.Name += "new2"
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Jul 14 06:55:54 GMT 2022
    - 1.6K bytes
    - Viewed (0)
  8. 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 Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 22.7K bytes
    - Viewed (0)
  9. callbacks/delete.go

    			case schema.HasOne, schema.HasMany:
    				queryConds := rel.ToQueryConditions(db.Statement.Context, db.Statement.ReflectValue)
    				modelValue := reflect.New(rel.FieldSchema.ModelType).Interface()
    				tx := db.Session(&gorm.Session{NewDB: true}).Model(modelValue)
    				withoutConditions := false
    				if db.Statement.Unscoped {
    					tx = tx.Unscoped()
    				}
    
    				if len(db.Statement.Selects) > 0 {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Feb 25 02:48:23 GMT 2022
    - 5.6K bytes
    - Viewed (0)
  10. migrator.go

    func (db *DB) Migrator() Migrator {
    	tx := db.getInstance()
    
    	// apply scopes to migrator
    	for len(tx.Statement.scopes) > 0 {
    		tx = tx.executeScopes()
    	}
    
    	return tx.Dialector.Migrator(tx.Session(&Session{}))
    }
    
    // AutoMigrate run auto migration for given models
    func (db *DB) AutoMigrate(dst ...interface{}) error {
    	return db.Migrator().AutoMigrate(dst...)
    }
    
    // ViewOption view option
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 3.1K bytes
    - Viewed (0)
Back to top