type TableA struct {
ID int
Name string
TableBs []*TableB `bun:"rel:has-many,join:id=table_aid"`
}
type TableB struct{
ID int
TableAID int
Num int
}
There is no way to perform an inner join for a many relation using ORM Relation, in order to exclude TableA elements without TableB elements that suit one condition.
The following query gets TablaA elements with nil TableBs field, and there is no way to exclude them:
having a model relation
There is no way to perform an inner join for a many relation using ORM Relation, in order to exclude TableA elements without TableB elements that suit one condition.
The following query gets TablaA elements with nil TableBs field, and there is no way to exclude them: