Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 49 for field1s (0.33 sec)

  1. scan.go

    			mapValue[column] = nil
    		}
    	}
    }
    
    func (db *DB) scanIntoStruct(rows Rows, reflectValue reflect.Value, values []interface{}, fields []*schema.Field, joinFields [][]*schema.Field) {
    	for idx, field := range fields {
    		if field != nil {
    			values[idx] = field.NewValuePool.Get()
    		} else if len(fields) == 1 {
    			if reflectValue.CanAddr() {
    				values[idx] = reflectValue.Addr().Interface()
    			} else {
    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/constraint.go

    }
    
    // ParseUniqueConstraints parse schema unique constraints
    func (schema *Schema) ParseUniqueConstraints() map[string]UniqueConstraint {
    	uniques := make(map[string]UniqueConstraint)
    	for _, field := range schema.Fields {
    		if field.Unique {
    			name := schema.namer.UniqueName(schema.Table, field.DBName)
    			uniques[name] = UniqueConstraint{Name: name, Field: field}
    		}
    	}
    	return uniques
    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)
  3. schema/serializer.go

    	Value(ctx context.Context, field *Field, dst reflect.Value, fieldValue interface{}) (interface{}, error)
    }
    
    // JSONSerializer json serializer
    type JSONSerializer struct{}
    
    // Scan implements serializer interface
    func (JSONSerializer) Scan(ctx context.Context, field *Field, dst reflect.Value, dbValue interface{}) (err error) {
    	fieldValue := reflect.New(field.FieldType)
    
    	if dbValue != nil {
    		var bytes []byte
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 08:28:46 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  4. tests/embedded_struct_test.go

    	stmt := gorm.Statement{DB: DB}
    	if err := stmt.Parse(&EngadgetPost{}); err != nil {
    		t.Fatalf("failed to parse embedded struct")
    	} else if len(stmt.Schema.PrimaryFields) != 1 {
    		t.Errorf("should have only one primary field with embedded struct, but got %v", len(stmt.Schema.PrimaryFields))
    	}
    
    	for _, name := range []string{"user_id", "user_name", "user_email"} {
    		if !DB.Migrator().HasColumn(&HNPost{}, name) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Oct 26 03:58:13 GMT 2023
    - 7.3K bytes
    - Viewed (0)
  5. tests/joins_test.go

    	if db5.Error != nil {
    		t.Errorf("Should not raise error for join where identical fields in different tables. Error: %s", db5.Error.Error())
    	}
    
    	var users6 []User
    	DB.Joins("inner join pets on pets.user_id = users.id AND pets.name = @Name", user.Pets[0]).Where("users.name = ?", user.Name).First(&users6)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Apr 26 14:19:32 GMT 2023
    - 13.5K bytes
    - Viewed (1)
  6. tests/create_test.go

    	err := DB.Create(&jt).Error
    	if err != nil {
    		t.Errorf("No error should happen when create a record without a GORM primary key. But in the database this primary key exists and is the union of 2 or more fields\n But got: %s", err)
    	}
    }
    
    func TestSelectWithCreate(t *testing.T) {
    	user := *GetUser("select_create", 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: Tue Mar 19 03:50:28 GMT 2024
    - 26.4K bytes
    - Viewed (0)
  7. schema/relationship_test.go

    	}
    
    	if createdByRel, ok := userSchema.Relationships.Relations["CreatedBy"]; ok {
    		if createdByRel.FieldSchema != userSchema {
    			t.Fatalf("expects same field schema, but got new %p, old %p", createdByRel.FieldSchema, userSchema)
    		}
    	} else {
    		t.Fatalf("expects created by relations, but not found")
    	}
    }
    
    func TestEmbeddedHas(t *testing.T) {
    	type Toy struct {
    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)
  8. tests/customize_field_test.go

    	if cc2.Name != "bar" {
    		t.Errorf("Failed to query CustomizeColumn")
    	}
    }
    
    func TestCustomColumnAndIgnoredFieldClash(t *testing.T) {
    	// Make sure an ignored field does not interfere with another field's custom
    	// column name that matches the ignored field.
    	type CustomColumnAndIgnoredFieldClash struct {
    		Body    string `gorm:"-"`
    		RawBody string `gorm:"column:body"`
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Sep 11 09:33:31 GMT 2020
    - 6.9K bytes
    - Viewed (0)
  9. tests/migrate_test.go

    		}
    		_ = stmt.Schema.ParseIndexes()
    		field := stmt.Schema.LookUpField(fieldName)
    		if field == nil {
    			t.Fatalf("%v: failed to find column %q", utils.FileWithLineNum(), fieldName)
    		}
    		if field.Unique != unique {
    			t.Fatalf("%v: %q column %q unique should be %v but got %v", utils.FileWithLineNum(), stmt.Schema.Table, fieldName, unique, field.Unique)
    		}
    		if field.UniqueIndex != uniqueIndex {
    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)
  10. finisher_api.go

    		expr := clause.Expr{SQL: "count(*)"}
    
    		if len(tx.Statement.Selects) == 1 {
    			dbName := tx.Statement.Selects[0]
    			fields := strings.FieldsFunc(dbName, utils.IsValidDBNameChar)
    			if len(fields) == 1 || (len(fields) == 3 && (strings.ToUpper(fields[1]) == "AS" || fields[1] == ".")) {
    				if tx.Statement.Parse(tx.Statement.Model) == nil {
    					if f := tx.Statement.Schema.LookUpField(dbName); f != nil {
    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)
Back to top