This is just a feature request. Currently, I can generate the model and boiler produces the struct for
Columns with fields for each column name that I can use in the project. Digging deeper, I was impressed with the model support for 1 to1 and 1 to Many relationships, so I jumped on it.
I like it a lot, however, there is one thing that would be a great addition. Currently if I want to eager load a relationship I have to set the string value name of the relationship in the query mod using the Load(<relationship>). There is no <table>.R.RNames.<relation> that provides the name generated by the model. This makes it possible for the code base to get out of sync with the model unless I modify the model itself to provide this. For example if the name of the foreign key constraint ( MySQL ) is changed.
Lastly, given the other features this just seems missing :)
Thanks for the suggestion. May get around to this sometime, would definitely accept a PR adding more top-level definitions like we do for Columns already:
First off, excellent tool!
This is just a feature request. Currently, I can generate the model and boiler produces the struct for
I like it a lot, however, there is one thing that would be a great addition. Currently if I want to eager load a relationship I have to set the string value name of the relationship in the query mod using the
Load(<relationship>)
. There is no<table>.R.RNames.<relation>
that provides the name generated by the model. This makes it possible for the code base to get out of sync with the model unless I modify the model itself to provide this. For example if the name of the foreign key constraint ( MySQL ) is changed.Lastly, given the other features this just seems missing :)
Thanks again for the tool!
Thanks for the suggestion. May get around to this sometime, would definitely accept a PR adding more top-level definitions like we do for Columns already:
https://github.com/volatiletech/sqlboiler/blob/master/templates/00_struct.tpl#L20
This exists now. See models.XRels
Wooohooo!!!