Skip to content

Add pagination to ColdFront API for large query requests#686

Closed
chrisdaaz wants to merge 4 commits intocoldfront:mainfrom
chrisdaaz:patch-1
Closed

Add pagination to ColdFront API for large query requests#686
chrisdaaz wants to merge 4 commits intocoldfront:mainfrom
chrisdaaz:patch-1

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.

@aebruno
Copy link
Member

aebruno commented Jul 2, 2025

@chrisdaaz If you want to sing the commit and fix up the conflict, this should be good to merge. Thanks!

@chrisdaaz
Copy link
Author

@aebruno sorry for the delay!

@aebruno
Copy link
Member

aebruno commented Jul 15, 2025

@chrisdaaz Thanks for updating this. Looks like you just need to run uv run ruff format to fix the formatting errors.

@chrisdaaz
Copy link
Author

@aebruno i gave that a try. apologies, i am very unfamiliar with uv!

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