Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for Sall (0.14 sec)

  1. prepare_stmt.go

    	defer close(cacheStmt.prepared)
    
    	// Reason why cannot lock conn.PrepareContext
    	// suppose the maxopen is 1, g1 is creating record and g2 is querying record.
    	// 1. g1 begin tx, g1 is requeue because of waiting for the system call, now `db.ConnPool` db.numOpen == 1.
    	// 2. g2 select lock `conn.PrepareContext(ctx, query)`, now db.numOpen == db.maxOpen , wait for release.
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Mar 28 08:47:39 GMT 2024
    - 6.4K bytes
    - Viewed (0)
  2. callbacks/helper.go

    	columns := make([]string, 0, len(mapValues))
    
    	// when the length of mapValues is zero,return directly here
    	// no need to call stmt.SelectAndOmitColumns method
    	if len(mapValues) == 0 {
    		stmt.AddError(gorm.ErrEmptySlice)
    		return
    	}
    
    	var (
    		result                    = make(map[string][]interface{}, len(mapValues))
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Apr 14 12:32:57 GMT 2022
    - 3.7K bytes
    - Viewed (0)
  3. tests/joins_table_test.go

    		t.Fatalf("Should found soft deleted addresses with unscoped")
    	}
    
    	DB.Model(&person).Association("Addresses").Clear()
    
    	if DB.Model(&person).Association("Addresses").Count() != 0 {
    		t.Fatalf("Should deleted all addresses")
    	}
    
    	if DB.Unscoped().Model(&person).Association("Addresses").Count() != 2 {
    		t.Fatalf("Should found soft deleted addresses with unscoped")
    	}
    
    	DB.Unscoped().Model(&person).Association("Addresses").Clear()
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Sep 10 13:46:18 GMT 2020
    - 3.5K bytes
    - Viewed (0)
  4. tests/multi_primary_keys_test.go

    		t.Fatalf("Tag should not be deleted when Delete with a unrelated tag")
    	}
    
    	// Clear
    	DB.Model(&blog).Association("Tags").Clear()
    	if DB.Model(&blog).Association("Tags").Count() != 0 {
    		t.Fatalf("All tags should be cleared")
    	}
    }
    
    func TestManyToManyWithCustomizedForeignKeys(t *testing.T) {
    	if name := DB.Dialector.Name(); name == "sqlite" || name == "sqlserver" {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 12.8K bytes
    - Viewed (0)
  5. callbacks/preload.go

    	}
    	for _, relations := range embeddedRelations.EmbeddedRelations {
    		names = append(names, embeddedValues(relations)...)
    	}
    	return names
    }
    
    // preloadEntryPoint enters layer by layer. It will call real preload if it finds the right entry point.
    // If the current relationship is embedded or joined, current query will be ignored.
    //
    //nolint:cyclop
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  6. chainable_api.go

    	db.Statement.scopes = nil
    	for _, scope := range scopes {
    		db = scope(db)
    	}
    	return db
    }
    
    // Preload preload associations with given conditions
    //
    //	// get all users, and preload all non-cancelled orders
    //	db.Preload("Orders", "state NOT IN (?)", "cancelled").Find(&users)
    func (db *DB) Preload(query string, args ...interface{}) (tx *DB) {
    	tx = db.getInstance()
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Apr 17 03:38:55 GMT 2024
    - 14.3K bytes
    - Viewed (1)
  7. 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)
  8. tests/callbacks_test.go

    				var argValues []reflect.Value
    				for _, arg := range args {
    					argValues = append(argValues, reflect.ValueOf(arg))
    				}
    
    				results := reflect.ValueOf(s).MethodByName(name).Call(argValues)
    				if len(results) > 0 {
    					v = results[0].Interface()
    				}
    			}
    
    			if c.name == "" {
    				c.name = getFuncName(c.h)
    			}
    
    			if c.before != "" {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Mar 26 03:33:36 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  9. tests/hooks_test.go

    		if products[idx].Price != value {
    			t.Errorf("invalid price for product #%v, expects: %v, got %v", idx, value, products[idx].Price)
    		}
    	}
    
    	DB.Model(&products).Update("Name", "product-name")
    
    	// will set all product's price to last product's price + 10
    	for idx, value := range []int64{410, 410, 410} {
    		if products[idx].Price != value {
    			t.Errorf("invalid price for product #%v, expects: %v, got %v", idx, value, products[idx].Price)
    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)
  10. callbacks/associations.go

    	}
    
    	return db.AddError(tx.Create(values).Error)
    }
    
    // check association values has been saved
    // if values kind is Struct, check it has been saved
    // if values kind is Slice/Array, check all items have been saved
    var visitMapStoreKey = "gorm:saved_association_map"
    
    func checkAssociationsSaved(db *gorm.DB, values reflect.Value) bool {
    	if visit, ok := db.Get(visitMapStoreKey); ok {
    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)
Back to top