Skip to content

Conversation

@edlenox
Copy link

@edlenox edlenox commented Sep 24, 2014

This is something I did a while ago. It is a hack to allow all of my sideloaded resources of a paged model to be loaded rather than just the same total number as the primary resource.

Currently what appears to happen is that you get the page size number of sideloads which isn't what I want.

Ideally the page size would apply to the individual items in the paged model, but I couldn't figure out the sql to do that in one call and I didn't want to be doing a call per model, so I rolled back the option code I wrote to allow it to be passed in.

I think primarily this is an sql problem.

It is an ugly hack, so I'd like to see something nicer.

@GavinJoyce
Copy link
Contributor

Thanks, this is something that I'd like to add support for. I've a few ideas...

@aaronbhansen
Copy link

On a similar note, I'm finding I want my side loaded entities to be either fully loaded, or the same page size as set on my query.
Any thoughts on:

  • Having an "all" option for paging. You can always pass a large page size, but it would be nice when I just want everything
  • Having an "all" option for side loading. It would be great on sub relations to be able to pull everything in all at once.

@edlenox
Copy link
Author

edlenox commented Oct 30, 2014

My current thoughts on this are that "side loading" isn't really
appropriate for what I use it for, i.e. comments on messages, as comments
are associated with only a single message. Therefore I plan to refactor to
insert the comments directly into the JSON rather than merely reference
them. I will put logic in the serializer to deal with page size if I need
it.

Side loading/links seems better suited to many-to-many relationships where
the associated entities are referred to by many first order elements..

On Thu, Oct 30, 2014 at 3:42 AM, Aaron Hansen notifications@github.com
wrote:

On a similar note, I'm finding I want my side loaded entities to be either
fully loaded, or the same page size as set on my query.
Any thoughts on:

  • Having an "all" option for paging. You can always pass a large page
    size, but it would be nice when I just want everything
  • Having an "all" option for side loading. It would be great on sub
    relations to be able to pull everything in all at once.


Reply to this email directly or view it on GitHub
#96 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants