-
Notifications
You must be signed in to change notification settings - Fork 15
Support for join
/alsoDecode
#12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I've not given this much thought as it's not crossed my mind, however, I do see how this would be a need for some people. I'll look into implementing something like this, but if you do have any ideas, feel free to submit PR |
I think this would be a very welcoming addition. Personally, I have an example of a If we had support for something like @Cellane proposes, then we don't have to do a weird dance of type erasure in order to support decoding/encoding of that heterogeneous array and instead rely on the multi-type pagination to return a result including a separate array for every type. |
Just wanted to circle back to these issues and say I haven't forgotten about them. Just been swamped lately so haven't had a chance to work on anything regarding these packages. 🙂 |
Any progress here? |
Motivation Behind Feature
At this moment, unless I’m mistaken, Pagination needs to operate on a
QueryBuilder
that producesFuture<[Model]>
. That makes it unable to paginate results that also fetch data from a different table, by using the Fluent’sjoin(_:to:)
/alsoDecode(_:)
methods, as these change the eventual output ofQueryBuilder
toFuture<[(ModelA, ModelB)]>
.Feature Description
It would be awesome if we could paginate even these slightly more complicated queries. I get a feeling that the eventual implementation would have to also rely on an implementation of #11 that would allow us to specify how should the end result be joined for a valid JSON representation.
Alternatives or Workarounds
None considered or thought of.
The text was updated successfully, but these errors were encountered: