Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for needed (0.14 sec)

  1. scan.go

    							}
    						} else {
    							matchedFieldCount[column] = 1
    						}
    					} else if names := utils.SplitNestedRelationName(column); len(names) > 1 { // has nested relation
    						if rel, ok := sch.Relationships.Relations[names[0]]; ok {
    							subNameCount := len(names)
    							// nested relation fields
    							relFields := make([]*schema.Field, 0, subNameCount-1)
    							relFields = append(relFields, rel.Field)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 09:53:11 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  2. schema/relationship_test.go

    		VisitingAddress Address `gorm:"embedded;embeddedPrefix:visiting_address_"`
    		AddressID       int
    		Address         struct {
    			ID int
    			Address
    		}
    		NestedAddress *NestedAddress `gorm:"embedded;embeddedPrefix:nested_address_"`
    		CountryMixin
    	}
    
    	s, err := schema.Parse(&Org{}, &sync.Map{}, schema.NamingStrategy{})
    	if err != nil {
    		t.Errorf("Failed to parse schema, got error %v", err)
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 25.5K bytes
    - Viewed (0)
  3. migrator/migrator.go

    			if length > 0 && field.Size > 0 {
    				alterColumn = true
    			} else {
    				// has size in data type and not equal
    				// Since the following code is frequently called in the for loop, reg optimization is needed here
    				matches2 := regFullDataType.FindAllStringSubmatch(fullDataType, -1)
    				if !field.PrimaryKey &&
    					(len(matches2) == 1 && matches2[0][1] != fmt.Sprint(length) && ok) {
    					alterColumn = true
    				}
    			}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  4. tests/scanner_valuer_test.go

    		*data = []byte(s[3:])
    		return nil
    	}
    
    	return errors.New("Bytes expected")
    }
    
    func (data EncryptedData) Value() (driver.Value, error) {
    	if len(data) > 0 && data[0] == 'x' {
    		// needed to test failures
    		return nil, errors.New("Should not start with 'x'")
    	}
    
    	// prepend asterisks
    	return append([]byte("***"), data...), nil
    }
    
    type Num int64
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Jun 07 07:02:07 GMT 2023
    - 10.6K bytes
    - Viewed (0)
  5. utils/utils.go

    		return strconv.FormatUint(v, 10)
    	}
    	return ""
    }
    
    const nestedRelationSplit = "__"
    
    // NestedRelationName nested relationships like `Manager__Company`
    func NestedRelationName(prefix, name string) string {
    	return prefix + nestedRelationSplit + name
    }
    
    // SplitNestedRelationName Split nested relationships to `[]string{"Manager","Company"}`
    func SplitNestedRelationName(name string) []string {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 22 06:43:02 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  6. callbacks/query.go

    					relation, ok := db.Statement.Schema.Relationships.Relations[join.Name]
    					if ok {
    						isRelations = true
    						relations = append(relations, relation)
    					} else {
    						// handle nested join like "Manager.Company"
    						nestedJoinNames := strings.Split(join.Name, ".")
    						if len(nestedJoinNames) > 1 {
    							isNestedJoin := true
    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)
  7. finisher_api.go

    // they are rolled back.
    func (db *DB) Transaction(fc func(tx *DB) error, opts ...*sql.TxOptions) (err error) {
    	panicked := true
    
    	if committer, ok := db.Statement.ConnPool.(TxCommitter); ok && committer != nil {
    		// nested transaction
    		if !db.DisableNestedTransaction {
    			err = db.SavePoint(fmt.Sprintf("sp%p", fc)).Error
    			if err != nil {
    				return
    			}
    			defer func() {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 22.7K bytes
    - Viewed (0)
  8. tests/migrate_test.go

    	AssertEqual(t, nil, err)
    	AssertEqual(t, "text[]", ct.DatabaseTypeName())
    
    	ct, err = findColumnType(&ArrayTypeModel{}, "nested_text_array")
    	AssertEqual(t, nil, err)
    	AssertEqual(t, "text[]", ct.DatabaseTypeName())
    
    	ct, err = findColumnType(&ArrayTypeModel{}, "nested_int_array")
    	AssertEqual(t, nil, err)
    	AssertEqual(t, "integer[]", ct.DatabaseTypeName())
    }
    
    type mockMigrator struct {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  9. tests/transaction_test.go

    		t.Fatalf("Should find saved record")
    	}
    }
    
    func TestNestedTransactionWithBlock(t *testing.T) {
    	var (
    		user  = *GetUser("transaction-nested", Config{})
    		user1 = *GetUser("transaction-nested-1", Config{})
    		user2 = *GetUser("transaction-nested-2", Config{})
    	)
    
    	if err := DB.Transaction(func(tx *gorm.DB) error {
    		tx.Create(&user)
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Jun 10 13:05:19 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  10. schema/index_test.go

    	// Composite Index: Flattened structure.
    	Data0A string `gorm:"index:,composite:comp_id0"`
    	Data0B string `gorm:"index:,composite:comp_id0"`
    
    	// Composite Index: Nested structure.
    	Data1A string `gorm:"index:,composite:comp_id1"`
    	CompIdxLevel1C
    
    	// Composite Index: Unique and priority.
    	Data2A string `gorm:"index:,unique,composite:comp_id2,priority:2"`
    	CompIdxLevel2C
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 8K bytes
    - Viewed (0)
Back to top