You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm fairly new to gorm, and only looked at this library in the past hour.
I have a set of models which I have included some simplified versions of below.
How feasible might it be to add functionality to this library that would allow filtering by User.Email when querying for a list of Devices via the Device.Users many2many relationship?
Does the library currently have any support for filtering via relationships?
type Device struct {
ID int32 `gorm:"column:id;type:int;primaryKey;autoIncrement:true" json:"id" filter:"param:id;searchable;filterable"`
Users []*User `gorm:"many2many:userDevice;foreignKey:id;joinForeignKey:deviceId;References:id;JoinReferences:userId"`
}
type UserDevice struct {
ID int32 `gorm:"column:id;type:int;primaryKey;autoIncrement:true" json:"id"`
DeviceID *int32 `gorm:"column:deviceId;type:int;uniqueIndex:uniqueEntry,priority:3;index:deviceUser,priority:1" json:"deviceId"`
UserID *int32 `gorm:"column:userId;type:int;uniqueIndex:uniqueEntry,priority:1;index:deviceUser,priority:2" json:"userId"`
}
type User struct {
ID int32 `gorm:"column:id;type:int;primaryKey;autoIncrement:true" json:"id"`
Email string `gorm:"column:email;type:varchar(512);not null;uniqueIndex:uniqueemail,priority:1" json:"email"`
}
The text was updated successfully, but these errors were encountered:
I'm fairly new to gorm, and only looked at this library in the past hour.
I have a set of models which I have included some simplified versions of below.
How feasible might it be to add functionality to this library that would allow filtering by
User.Email
when querying for a list of Devices via theDevice.Users
many2many relationship?Does the library currently have any support for filtering via relationships?
The text was updated successfully, but these errors were encountered: