-
-
Notifications
You must be signed in to change notification settings - Fork 151
Open
Description
Is your feature request related to a problem?
- Yes, it is related to a problem
Describe the feature you'd like
🌟 Feature Description
Add pagination support to all backend list endpoints (/users/, /sponsorships/, /posts/, /sponsorship-applications/, /collaborations/) to prevent performance degradation as the database grows.
🔍 Problem Statement
Currently, all list endpoints fetch ALL records from the database without any pagination limits. For example:
@router.get("/users/")
async def get_users():
result = supabase.table("users").select("*").execute() # Returns every user!
return resultAs the platform scales to hundreds/thousands of users, sponsorships, and posts, this will cause:
- Severe database performance issues
- Network timeouts on the frontend
- High memory consumption on both client and server
- Poor user experience with infinite scroll loading
🎯 Expected Outcome
All list endpoints should support pagination with:
- Query parameters: skip (offset) and limit (items per page)
- Default values: skip=0, limit=50
- Maximum limit: 100 items per request
- Response should include:
- data: Array of items
- total: Total count of items
- has_more: Boolean indicating if more items exist
- skip: Current offset
- limit: Items per page
Record
- I agree to follow this project's Code of Conduct
- I want to work on implementing this feature
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels