go-gorm / gorm

The fantastic ORM library for Golang, aims to be developer friendly
https://gorm.io
MIT License
36.03k stars 3.86k forks source link

cannot find encode plan #7045

Closed andysay closed 1 day ago

andysay commented 1 month ago
type Streaming struct {
    RoomID    string    `gorm:"primaryKey"`
    Title     string    `gorm:"not null"`
    UserID    uuid.UUID `gorm:"type:uuid;not null"` 
    CreatedAt time.Time `gorm:"not null"`
}

type Profile struct {
    ID             uint64         `gorm:"primaryKey"`
    UserID         uuid.UUID      `gorm:"type:uuid;not null;unique"`

    Streaming []Streaming `gorm:"foreignKey:UserID;references:UserID;type:uuid"`
}

return 

failed to encode args[17]: unable to encode models.Streaming{RoomID:"room123", Title:"Gaming Stream", UserID:uuid.UUID{0x16, 0x52, 0x59, 0x4e, 0xaf, 0x5, 0x4c, 0x12, 0xa5, 0x52, 0xeb, 0xe6, 0x1f, 0x91, 0x56, 0xcb}, CreatedAt:time.Date(2024, time.June, 1, 12, 0, 0, 0, time.UTC)} 
into binary format for uuid (OID 2950): cannot find encode plan
github-actions[bot] commented 1 month ago

The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.ioSearch Before Asking