Open
Description
From readme:
Foreign keys do not have to be in the model, they are automagically managed underneath by kallax.
AFAICT there is no way to get fk value without querying relation. And when I include foreign key to struct, kallax generates invalid code.
type Post struct {
kallax.Model
AuthorID int64
Author *User `fk:",inverse"`
// ...
}
Kallax generates duplicate switch statement cases for "author_id"
field in func (r *Post) ColumnAddress
and func (r *Post) Value
methods.
UPDATE
And by the way, how to load "inverse" relations for object without re-querying everything using With<Relation>
methods ? This "virtual columns" seem to just add more complexity and inconveniences without providing reasonable value.