Skip to content

Add pagination to ColdFront API for large query requests #686

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chrisdaaz
Copy link

I love the new ColdFront API! I got an error trying the /api/projects/?project_users=true endpoint due to the large number of results. That might have been because I was using SQLite, but maybe this would be useful to have? I wasn't sure what PAGE_SIZE to start with. Just a thought!

@aebruno
Copy link
Member

aebruno commented May 30, 2025

@chrisdaaz This looks good. Curious, what was the error and how large was your dataset? Just curious if we could bump the default page size a bit larger, maybe 1000? Also, don't forget to sign your commit. Thanks for the PR!

@chrisdaaz
Copy link
Author

I get an OperationalError: too many SQL variables when the PAGE_SIZE is too high. I think it's related to SQLite limitations? I'll sign the commit and up the PAGE_SIZE to 750, which works for me.

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.

2 participants