Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 18 of 18 for Unscoped (0.19 sec)

  1. association.go

    		}
    	} else {
    		association.Error = err
    	}
    
    	return association
    }
    
    func (association *Association) Unscoped() *Association {
    	return &Association{
    		DB:           association.DB,
    		Relationship: association.Relationship,
    		Error:        association.Error,
    		Unscope:      true,
    	}
    }
    
    func (association *Association) Find(out interface{}, conds ...interface{}) error {
    	if association.Error == nil {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu May 04 11:30:45 GMT 2023
    - 21.2K bytes
    - Viewed (0)
  2. callbacks/preload.go

    				}
    			} else {
    				tx := db.Table("").Session(&gorm.Session{Context: db.Statement.Context, SkipHooks: db.Statement.SkipHooks})
    				tx.Statement.ReflectValue = db.Statement.ReflectValue
    				tx.Statement.Unscoped = db.Statement.Unscoped
    				if err := preload(tx, rel, append(preloads[name], associationsConds...), preloadMap[name]); err != nil {
    					return err
    				}
    			}
    		} else {
    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)
  3. tests/preload_test.go

    	if len(user4.Pets) != 0 {
    		t.Fatalf("User.Pet[0] was deleted and should not exist.")
    	}
    
    	var user5 User
    	DB.Unscoped().Preload(clause.Associations+"."+clause.Associations).Find(&user5, "id = ?", user.ID)
    	CheckUserUnscoped(t, user5, user)
    
    	var user6 *User
    	DB.Unscoped().Preload("Pets.Toy").Find(&user6, "id = ?", user.ID)
    	CheckUserUnscoped(t, *user6, user)
    }
    
    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. statement.go

    }
    
    func (stmt *Statement) clone() *Statement {
    	newStmt := &Statement{
    		TableExpr:            stmt.TableExpr,
    		Table:                stmt.Table,
    		Model:                stmt.Model,
    		Unscoped:             stmt.Unscoped,
    		Dest:                 stmt.Dest,
    		ReflectValue:         stmt.ReflectValue,
    		Clauses:              map[string]clause.Clause{},
    		Distinct:             stmt.Distinct,
    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)
  5. tests/associations_belongs_to_test.go

    			Logo: "logo",
    		},
    	}
    	if err := tx.Create(&item).Error; err != nil {
    		t.Fatalf("failed to create items, got error: %v", err)
    	}
    
    	// test replace
    	if err := tx.Model(&item).Association("ItemParent").Unscoped().Replace(&ItemParent{
    		Logo: "updated logo",
    	}); err != nil {
    		t.Errorf("failed to replace item parent, got error: %v", err)
    	}
    
    	var parents []ItemParent
    	if err := tx.Find(&parents).Error; err != nil {
    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/update_test.go

    	if !regexp.MustCompile(`.users.\..deleted_at. IS NULL`).MatchString(stmt.SQL.String()) {
    		t.Fatalf("invalid updating SQL, got %v", stmt.SQL.String())
    	}
    
    	dryDB = DB.Session(&gorm.Session{DryRun: true})
    	stmt = dryDB.Unscoped().Save(&user).Statement
    	if !regexp.MustCompile(`WHERE .id. = [^ ]+$`).MatchString(stmt.SQL.String()) {
    		t.Fatalf("invalid updating SQL, got %v", stmt.SQL.String())
    	}
    
    	user3 := *GetUser("save3", Config{})
    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. src/cmd/asm/internal/asm/asm.go

    func (p *Parser) asmText(operands [][]lex.Token) {
    	if len(operands) != 2 && len(operands) != 3 {
    		p.errorf("expect two or three operands for TEXT")
    		return
    	}
    
    	// Labels are function scoped. Patch existing labels and
    	// create a new label space for this TEXT.
    	p.patch()
    	p.labels = make(map[string]*obj.Prog)
    
    	// Operand 0 is the symbol name in the form foo(SB).
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Feb 21 14:34:57 GMT 2024
    - 25.3K bytes
    - Viewed (0)
  8. cni/pkg/repair/repaircontroller.go

    		}
    		return nil
    	}
    	log.Infof("Repairing pod...")
    
    	// Fetch the pod's network namespace. This must run in the host process due to how the procfs /ns/net works.
    	// This will get a network namespace ID. This ID is scoped to the network namespace we running in.
    	// As such, we need to be in the host namespace: the CNI pod namespace has no relation to the users pod namespace.
    	netns, err := runInHost(func() (string, error) { return getPodNetNs(pod) })
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Sat Feb 10 00:31:55 GMT 2024
    - 10.4K bytes
    - Viewed (0)
Back to top