Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for Omit (0.13 sec)

  1. tests/create_test.go

    	user.Team = nil
    	user.Friends = nil
    
    	CheckUser(t, user2, user)
    }
    
    func TestOmitWithCreate(t *testing.T) {
    	user := *GetUser("omit_create", Config{Account: true, Pets: 3, Toys: 3, Company: true, Manager: true, Team: 3, Languages: 3, Friends: 4})
    	DB.Omit("Account", "Toys", "Manager", "Birthday").Create(&user)
    
    	var result 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)
  2. chainable_api.go

    			}
    		}
    	default:
    		tx.AddError(fmt.Errorf("unsupported select args %v %v", query, args))
    	}
    
    	return
    }
    
    // Omit specify fields that you want to ignore when creating, updating and querying
    func (db *DB) Omit(columns ...string) (tx *DB) {
    	tx = db.getInstance()
    
    	if len(columns) == 1 && strings.ContainsRune(columns[0], ',') {
    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)
  3. tests/update_test.go

    	}
    }
    
    func TestOmitWithUpdate(t *testing.T) {
    	user := *GetUser("omit_update", Config{Account: true, Pets: 3, Toys: 3, Company: true, Manager: true, Team: 3, Languages: 3, Friends: 4})
    	DB.Create(&user)
    
    	var result User
    	DB.First(&result, user.ID)
    
    	user2 := *GetUser("omit_update_new", Config{Account: true, Pets: 3, Toys: 3, Company: true, Manager: true, Team: 3, Languages: 3, Friends: 4})
    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)
  4. statement.go

    			columnName := matches[3]
    			if star != "" {
    				return table, star
    			}
    			return table, columnName
    		}
    		return "", ""
    	}
    }()
    
    // SelectAndOmitColumns get select and omit columns, select -> true, omit -> false
    func (stmt *Statement) SelectAndOmitColumns(requireCreate, requireUpdate bool) (map[string]bool, bool) {
    	results := map[string]bool{}
    	notRestricted := false
    
    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/query_test.go

    		t.Fatal("expected errors to have occurred, but nothing happened")
    	}
    	if totalBatch != 0 {
    		t.Fatalf("incorrect total batch, expected: %v, got: %v", 0, totalBatch)
    	}
    
    	if result := DB.Omit("id").Where("name = ?", users[0].Name).FindInBatches(&results, 2, func(tx *gorm.DB, batch int) error {
    		totalBatch += batch
    		return nil
    	}); result.Error != gorm.ErrPrimaryKeyRequired {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 49.8K bytes
    - Viewed (0)
  6. src/cmd/api/main_test.go

    	case *types.Interface:
    		w.emitIfaceType(name, typ)
    		return // methods are handled by emitIfaceType
    	default:
    		w.emitf("type %s %s", name, w.typeString(typ.Underlying()))
    	}
    
    	// emit methods with value receiver
    	var methodNames map[string]bool
    	vset := types.NewMethodSet(typ)
    	for i, n := 0, vset.Len(); i < n; i++ {
    		m := vset.At(i)
    		if m.Obj().Exported() {
    			w.emitMethod(m)
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Apr 09 20:48:51 GMT 2024
    - 31.4K bytes
    - Viewed (0)
  7. istioctl/pkg/analyze/analyze.go

    				parts := strings.Split(s, "=")
    				if len(parts) != 2 {
    					return fmt.Errorf("%s is not a valid suppression value. See istioctl analyze --help", s)
    				}
    				// Check to see if the supplied code is valid. If not, emit a
    				// warning but continue.
    				codeIsValid := false
    				for _, at := range msg.All() {
    					if at.Code() == parts[0] {
    						codeIsValid = true
    						break
    					}
    				}
    
    				if !codeIsValid {
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Tue Apr 02 08:32:06 GMT 2024
    - 17K bytes
    - Viewed (0)
Back to top