Skip to content

Migration to fastapi-pagination

Choose a tag to compare

@Badx86 Badx86 released this 18 Jun 20:59
· 49 commits to main since this release

πŸš€ Features

  • Migrated to fastapi-pagination library for standardized pagination
  • Automatic OpenAPI schema generation for pagination parameters
  • Optimized SQL queries with built-in LIMIT/OFFSET handling

πŸ”„ Changes

  • Changed API parameter from per_page to size
  • Replaced manual pagination logic with paginate() function
  • Updated all database functions to use fastapi-pagination
  • Updated all tests to use new pagination parameters

πŸ› οΈ Technical Details

  • Added add_pagination(app) to main.py
  • Updated route parameters to use Params = Depends()
  • Simplified database functions with automatic pagination
  • All API endpoints now support standard ?page=1&size=6 format

πŸ“‹ API Changes

Before: GET /api/users?page=1&per_page=6
After: GET /api/users?page=1&size=6

βœ… Tests

  • All 62 tests passing
  • Updated test suite for new pagination parameters
  • Added comprehensive CRUD tests with database verification

Full Changelog: https://github.com/Badx86/python_advanced/commits/v1.0.0