bun
bun copied to clipboard
Add support for nested Relation
Instead of
q.Relation("Foo").Relation("Foo.Bar")
You should be able to write
q.Relation("Foo", func(q *SelectQuery) *SelectQuery {
return q.Relation("Bar")
}).
@vmihailenco I ran into this when trying to migration from go-pg. I have the statement:
Relation("Task.User.id")
And it now gives me an error in "bun":
Attachment does not have relation="Task.User.id"
This is a one to one to one relationship. Is this possible with bun?
@wavded it should be (AFAIR it is the same in pg v10)
q = db.Relation("Task.User", func(q *SelectQuery) *SelectQuery {
return q.Column("id")
})
That works! Thx @vmihailenco
@vmihailenco hey! Any progress on this issue?