Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for preloadDB (0.16 sec)

  1. callbacks/preload.go

    				tx.Statement.Unscoped = db.Statement.Unscoped
    				if err := preload(tx, rel, append(preloads[name], associationsConds...), preloadMap[name]); err != nil {
    					return err
    				}
    			}
    		} else {
    			return fmt.Errorf("%s: %w for schema %s", name, gorm.ErrUnsupportedRelation, db.Statement.Schema.Name)
    		}
    	}
    	return nil
    }
    
    func preloadDB(db *gorm.DB, reflectValue reflect.Value, dest interface{}) *gorm.DB {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  2. callbacks/query.go

    		}
    
    		tx := preloadDB(db, db.Statement.ReflectValue, db.Statement.Dest)
    		if tx.Error != nil {
    			return
    		}
    
    		db.AddError(preloadEntryPoint(tx, joins, &tx.Statement.Schema.Relationships, db.Statement.Preloads, db.Statement.Preloads[clause.Associations]))
    	}
    }
    
    func AfterQuery(db *gorm.DB) {
    	// clear the joins after query because preload need it
    	db.Statement.Joins = nil
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Jan 29 03:34:57 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  3. tests/preload_test.go

    	)
    
    	DB.Migrator().DropTable(&Preload{}, &Join{}, &Nested{}, &Value{})
    	DB.Migrator().AutoMigrate(&Preload{}, &Join{}, &Nested{}, &Value{})
    
    	value1 := Value{
    		Name: "value",
    		Nested: Nested{
    			Preloads: []*Preload{
    				{Value: "p1"}, {Value: "p2"},
    			},
    			Join: Join{Value: "j1"},
    		},
    	}
    	value2 := Value{
    		Name: "value2",
    		Nested: Nested{
    			Preloads: []*Preload{
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 14.9K bytes
    - Viewed (0)
  4. chainable_api.go

    		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()
    	if tx.Statement.Preloads == nil {
    		tx.Statement.Preloads = map[string][]interface{}{}
    	}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Apr 17 03:38:55 GMT 2024
    - 14.3K bytes
    - Viewed (1)
  5. tests/create_test.go

    		t.Fatalf("errors happened when create: %v", err)
    	}
    
    	CheckUser(t, user, user)
    
    	var user2 User
    	DB.Preload("Account").Preload("Pets").Preload("Toys").Preload("Company").Preload("Manager").Preload("Team").Preload("Languages").Preload("Friends").Find(&user2, "id = ?", user.ID)
    	CheckUser(t, user2, user)
    }
    
    func TestBulkCreateWithAssociations(t *testing.T) {
    	users := []User{
    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)
  6. tests/update_test.go

    	result.Friends = user2.Friends
    
    	DB.Select("Name", "Account", "Toys", "Manager", "ManagerID", "Languages").Save(&result)
    
    	var result2 User
    	DB.Preload("Account").Preload("Pets").Preload("Toys").Preload("Company").Preload("Manager").Preload("Team").Preload("Languages").Preload("Friends").First(&result2, user.ID)
    
    	result.Languages = append(user.Languages, result.Languages...)
    	result.Toys = append(user.Toys, result.Toys...)
    
    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)
  7. internal/config/browser/browser.go

    	browserHSTSIncludeSubdomains = "hsts_include_subdomains"
    	// browserHSTSPreload setting name for Strict-Transport-Security response header 'preload' flag (true or false)
    	browserHSTSPreload = "hsts_preload"
    	// browserReferrerPolicy setting name for Referrer-Policy response header
    	browserReferrerPolicy = "referrer_policy"
    
    	EnvBrowserCSPPolicy             = "MINIO_BROWSER_CONTENT_SECURITY_POLICY"
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 11 01:10:30 GMT 2024
    - 5.8K bytes
    - Viewed (0)
  8. errors.go

    	// ErrInvalidValueOfLength invalid values do not match length
    	ErrInvalidValueOfLength = errors.New("invalid association values, length doesn't match")
    	// ErrPreloadNotAllowed preload is not allowed when count is used
    	ErrPreloadNotAllowed = errors.New("preload is not allowed when count is used")
    	// ErrDuplicatedKey occurs when there is a unique key constraint violation
    	ErrDuplicatedKey = errors.New("duplicated key not allowed")
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 02:53:17 GMT 2024
    - 2.5K bytes
    - Viewed (0)
  9. statement.go

    		newStmt.Vars = append(newStmt.Vars, stmt.Vars...)
    	}
    
    	for k, c := range stmt.Clauses {
    		newStmt.Clauses[k] = c
    	}
    
    	for k, p := range stmt.Preloads {
    		newStmt.Preloads[k] = p
    	}
    
    	if len(stmt.Joins) > 0 {
    		newStmt.Joins = make([]join, len(stmt.Joins))
    		copy(newStmt.Joins, stmt.Joins)
    	}
    
    	if len(stmt.scopes) > 0 {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 19.8K bytes
    - Viewed (0)
  10. internal/config/browser/help.go

    			Optional:    true,
    			Type:        "boolean",
    		},
    		config.HelpKV{
    			Key:         browserHSTSPreload,
    			Description: `turn 'on' to set Strict-Transport-Security 'preload' directive` + defaultHelpPostfix(browserHSTSPreload),
    			Optional:    true,
    			Type:        "boolean",
    		},
    		config.HelpKV{
    			Key:         browserReferrerPolicy,
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Mon Jan 01 16:36:33 GMT 2024
    - 2.1K bytes
    - Viewed (0)
Back to top