Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 29 of 29 for type (0.16 sec)

  1. callbacks/preload.go

    			return err
    		}
    	}
    
    	fieldValues := make([]interface{}, len(relForeignFields))
    
    	// clean up old values before preloading
    	switch reflectValue.Kind() {
    	case reflect.Struct:
    		switch rel.Type {
    		case schema.HasMany, schema.Many2Many:
    			tx.AddError(rel.Field.Set(tx.Statement.Context, reflectValue, reflect.MakeSlice(rel.Field.IndirectFieldType, 0, 10).Interface()))
    		default:
    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)
  2. tests/multi_primary_keys_test.go

    		t.Fatalf("EN Blog's tags should be cleared")
    	}
    }
    
    func TestCompositePrimaryKeysAssociations(t *testing.T) {
    	type Label struct {
    		BookID *uint  `gorm:"primarykey"`
    		Name   string `gorm:"primarykey"`
    		Value  string
    	}
    
    	type Book struct {
    		ID     int
    		Name   string
    		Labels []Label
    	}
    
    	DB.Migrator().DropTable(&Label{}, &Book{})
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 12.8K bytes
    - Viewed (0)
  3. schema/relationship.go

    	has       RelationshipType = "has"
    )
    
    type Relationships struct {
    	HasOne    []*Relationship
    	BelongsTo []*Relationship
    	HasMany   []*Relationship
    	Many2Many []*Relationship
    	Relations map[string]*Relationship
    
    	EmbeddedRelations map[string]*Relationships
    }
    
    type Relationship struct {
    	Name                     string
    	Type                     RelationshipType
    	Field                    *Field
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 22.4K bytes
    - Viewed (0)
  4. schema/field.go

    	"gorm.io/gorm/clause"
    	"gorm.io/gorm/utils"
    )
    
    // special types' reflect type
    var (
    	TimeReflectType    = reflect.TypeOf(time.Time{})
    	TimePtrReflectType = reflect.TypeOf(&time.Time{})
    	ByteReflectType    = reflect.TypeOf(uint8(0))
    )
    
    type (
    	// DataType GORM data type
    	DataType string
    	// TimeType GORM time type
    	TimeType int64
    )
    
    // GORM time types
    const (
    	UnixTime        TimeType = 1
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
  5. schema/schema.go

    	callbackTypeAfterFind    callbackType = "AfterFind"
    )
    
    // ErrUnsupportedDataType unsupported data type
    var ErrUnsupportedDataType = errors.New("unsupported data type")
    
    type Schema struct {
    	Name                      string
    	ModelType                 reflect.Type
    	Table                     string
    	PrioritizedPrimaryField   *Field
    	DBNames                   []string
    	PrimaryFields             []*Field
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Oct 10 06:50:29 GMT 2023
    - 13.7K bytes
    - Viewed (0)
  6. tests/associations_test.go

    	// do nothing
    }
    
    func TestAssociationEmptyQueryClause(t *testing.T) {
    	type Organization struct {
    		gorm.Model
    		Name string
    	}
    	type Region struct {
    		gorm.Model
    		Name          string
    		Organizations []Organization `gorm:"many2many:region_orgs;"`
    	}
    	type RegionOrg struct {
    		RegionId       uint
    		OrganizationId uint
    		Empty          myType
    	}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Feb 08 08:29:09 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  7. association.go

    			if clear {
    				fieldValue = reflect.MakeSlice(oldFieldValue.Type(), 0, oldFieldValue.Cap())
    			} else {
    				fieldValue = reflect.MakeSlice(oldFieldValue.Type(), oldFieldValue.Len(), oldFieldValue.Cap())
    				reflect.Copy(fieldValue, oldFieldValue)
    			}
    
    			appendToFieldValues := func(ev reflect.Value) {
    				if ev.Type().AssignableTo(elemType) {
    					fieldValue = reflect.Append(fieldValue, ev)
    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)
  8. gorm.go

    	}
    	return nil
    }
    
    // Option gorm option interface
    type Option interface {
    	Apply(*Config) error
    	AfterInitialize(*DB) error
    }
    
    // DB GORM DB definition
    type DB struct {
    	*Config
    	Error        error
    	RowsAffected int64
    	Statement    *Statement
    	clone        int
    }
    
    // Session session config when create session with Session() method
    type Session struct {
    	DryRun                   bool
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sun Aug 20 11:46:56 GMT 2023
    - 11.6K bytes
    - Viewed (0)
  9. tests/sql_builder_test.go

    		t.Errorf("Failed to generate sql, got %v", stmt2.SQL.String())
    	}
    }
    
    type ageInt int8
    
    func (ageInt) String() string {
    	return "age"
    }
    
    type ageBool bool
    
    func (ageBool) String() string {
    	return "age"
    }
    
    type ageUint64 uint64
    
    func (ageUint64) String() string {
    	return "age"
    }
    
    type ageFloat float64
    
    func (ageFloat) String() string {
    	return "age"
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 16.7K bytes
    - Viewed (0)
Back to top