If you've got a many-to-many relationship, the result of a with query will look like this:
(select foo (with bar))
=>
{ :id 5
:bar
[{:id 1
:desc "Hello!"}
{:id 2
:desc "World!"}]
}
Whereas a simple has-one relationship will result in this:
(select foo (with bar))
=>
{ :id 5
:desc "Hello!" }
even though desc is a field on bar, not foo. But let's say foo has a relationship with bar and baz, and both bar and baz have a field called "desc".
Korma does handle this case, giving us
(select foo
(with bar)
(with baz))
=>
{ :id 5
:desc "Hello!"
:desc_2 "Honey Bunches of Oats!"}
While that certainly works, I find it much more convenient, not to say more semantic, to have nested maps, like we see in the many-to-many relationships. Is there some way to force this? Is this problematic in some way I'm not foreseeing?
That is to say, something like this:
(select foo
(with bar)
(with baz))
=>
{ :id 5
:bar {:desc "Hello!"}
:baz {:desc "Honey Bunches of Oats!"}