-
-
Notifications
You must be signed in to change notification settings - Fork 264
Closed
Description
I need to query for entities that have a has-many relation with another table. Example:
type Recipe struct {
ID int64
Name string
Categories []*RecipeCategory `bun:"rel:has-many,join:id=recipe_id"`
}
type Category struct {
ID int64
Name string
}
type RecipeCategory struct {
ID int64
CategoryID int64
RecipeID int64
}Let's say I want to query for a recipe where category_id is equal to 1 or 2. How I can do that?
Metadata
Metadata
Assignees
Labels
No labels