Closed glerchundi closed 6 years ago
I don't mind it. It's fairly simple to do as we already generate all these names for the relationship structs. They should however be namespaced in some way. Currently the columns live under a "constant struct". Perhaps we should do the same for these?
Cool!
They should however be namespaced in some way. Currently the columns live under a "constant struct". Perhaps we should do the same for these?
Sounds reasonable. Let me sketch something and fill send a PR with a proposal
What do you prefer something 1) more explicit (one per each type of eager loading) or 2) one for all of them (they can't collide as the names pertain to the same table, right?):
var {{$alias.UpSingular}}OneToOneRelationships = struct {
}{
}
var {{$alias.UpSingular}}ToOneRelationships = struct {
}{
}
var {{$alias.UpSingular}}ToManyRelationships = struct {
}{
}
2.
var {{$alias.UpSingular}}Relationships = struct {
}{
}
WDYT?
SQLBoiler: v3
I would like to avoid hardcoding eager loading references and it would be interesting if SQLBoiler could automagically include those names as constants in generated code.
It's related to this issue but this applies to the names used to make a references to relationships.
Nested relations (more than 1 depth ones) can be created by the developer if the first levels ones are included.
WDYT?