Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 27 for ramble (0.14 sec)

  1. tests/create_test.go

    	}
    
    	// case 3: create from []map[string]interface{}
    	records := []map[string]interface{}{
    		{"name": "create_from_map_with_table_2", "age": 19},
    		{"name": "create_from_map_with_table_3", "age": 20},
    	}
    
    	tableDB = DB.Table("users")
    	if err := tableDB.Create(&records).Error; err != nil {
    		t.Fatalf("failed to create data from slice of map, got error: %v", err)
    	}
    
    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. schema/relationship_test.go

    		JoinTable: JoinTable{Name: "user_profiles", Table: "user_profiles"},
    		References: []Reference{
    			{"Refer", "User", "UserReferID", "user_profiles", "", true},
    			{"UserRefer", "Profile", "ProfileRefer", "user_profiles", "", false},
    		},
    	}, Relation{
    		Name: "Profiles2", Type: schema.Many2Many, Schema: "User", FieldSchema: "Profile",
    		JoinTable: JoinTable{Name: "user_profiles2", Table: "user_profiles2"},
    		References: []Reference{
    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. schema/constraint.go

    			} else {
    				if names[0] == "" {
    					chk = strings.Join(names[1:], ",")
    				}
    				name := schema.namer.CheckerName(schema.Table, field.DBName)
    				checks[name] = CheckConstraint{Name: name, Constraint: chk, Field: field}
    			}
    		}
    	}
    	return checks
    }
    
    type UniqueConstraint struct {
    	Name  string
    	Field *Field
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 07:33:54 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  4. callbacks.go

    		if err := stmt.Parse(stmt.Model); err != nil && (!errors.Is(err, schema.ErrUnsupportedDataType) || (stmt.Table == "" && stmt.TableExpr == nil && stmt.SQL.Len() == 0)) {
    			if errors.Is(err, schema.ErrUnsupportedDataType) && stmt.Table == "" && stmt.TableExpr == nil {
    				db.AddError(fmt.Errorf("%w: Table not set, please set it like: db.Model(&user) or db.Table(\"users\")", err))
    			} else {
    				db.AddError(err)
    			}
    		}
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 26 03:33:36 GMT 2024
    - 8.6K bytes
    - Viewed (1)
  5. tests/connpool_test.go

    		t.Fatalf("Should find saved record, but got %v", err)
    	}
    
    	tx2.Commit()
    
    	if err = db.First(&User{}, "name = ?", "transaction-2").Error; err != nil {
    		t.Fatalf("Should be able to find committed record, but got %v", err)
    	}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Feb 06 02:54:40 GMT 2024
    - 5.5K bytes
    - Viewed (0)
  6. migrator/migrator.go

    	stmt := &gorm.Statement{DB: m.DB}
    	if m.DB.Statement != nil {
    		stmt.Table = m.DB.Statement.Table
    		stmt.TableExpr = m.DB.Statement.TableExpr
    	}
    
    	if table, ok := value.(string); ok {
    		stmt.Table = table
    	} else if err := stmt.ParseWithSpecialTableName(value, stmt.Table); err != nil {
    		return err
    	}
    
    	return fc(stmt)
    }
    
    // DataTypeOf return field's db data type
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  7. callbacks/query.go

    										Column: clause.Column{Table: parentTableName, Name: ref.PrimaryKey.DBName},
    										Value:  clause.Column{Table: tableAliasName, Name: ref.ForeignKey.DBName},
    									}
    								} else {
    									if ref.PrimaryValue == "" {
    										exprs[idx] = clause.Eq{
    											Column: clause.Column{Table: parentTableName, Name: ref.ForeignKey.DBName},
    											Value:  clause.Column{Table: tableAliasName, Name: ref.PrimaryKey.DBName},
    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)
  8. clause/locking.go

    )
    
    type Locking struct {
    	Strength string
    	Table    Table
    	Options  string
    }
    
    // Name where clause name
    func (locking Locking) Name() string {
    	return "FOR"
    }
    
    // Build build where clause
    func (locking Locking) Build(builder Builder) {
    	builder.WriteString(locking.Strength)
    	if locking.Table.Name != "" {
    		builder.WriteString(" OF ")
    		builder.WriteQuoted(locking.Table)
    	}
    
    	if locking.Options != "" {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:32:56 GMT 2023
    - 773 bytes
    - Viewed (0)
  9. schema/schema_helper_test.go

    				if r.JoinTable.Name != relation.JoinTable.Name {
    					t.Errorf("schema %v relation's join table name expects %v, but got %v", s, relation.JoinTable.Name, r.JoinTable.Name)
    				}
    
    				if r.JoinTable.Table != relation.JoinTable.Table {
    					t.Errorf("schema %v relation's join table tablename expects %v, but got %v", s, relation.JoinTable.Table, r.JoinTable.Table)
    				}
    
    				for i := range relation.JoinTable.Fields {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 7.5K bytes
    - Viewed (0)
  10. tests/scopes_test.go

    		t.Errorf("Should found two users's name in 1, 3, but got %v", len(users3))
    	}
    
    	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{})
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 3.3K bytes
    - Viewed (0)
Back to top