Skip to content

0.16.0

Latest

Choose a tag to compare

@igorbenav igorbenav released this 10 Nov 20:29
· 34 commits to main since this release
16271bb

🚀 FastAPI Boilerplate v0.16.0

We're excited to announce v0.16.0 with major improvements to type safety and developer experience through the latest FastCRUD integration! 🎉

🌟 Key Highlights

  • Enhanced Type Safety: Upgraded to FastCRUD 0.19.1 with improved overloads for better type inference
  • Cleaner Codebase: Removed unnecessary manual type casting across the entire codebase
  • Better Developer Experience: Eliminated union types when using schema-based column selection
  • Health Check Endpoints: New endpoints for monitoring application health
  • Improved Documentation: Updated guides to reflect FastCRUD 0.19.0+ changes

🔧 What's Changed

  • 🔗 Fix: Fixed the discord link by @LucasQR in #203
  • 📚 Documentation: Updated docs to use SQLAlchemy 2.0 syntax by @carlosplanchon in #205
  • 🛠️ Fix: Update pre-commit hooks version to solve InvalidManifestError by @rragundez in #207
  • ⚙️ Enhancement: Update python specifier by @rragundez in #209
  • 🏥 New Feature: Add health check endpoints by @rragundez in #210
  • 📝 Documentation: Added note about falsy values from FastCRUD by @carlosplanchon in #214
  • 📦 Enhancement: Add pre-commit dependency in DEV group by @rragundez in #208
  • 🔄 Refactor: Adapt imports to FastCRUD 0.19.0 pagination structure by @carlosplanchon in #215
  • Major Update: Upgrade to FastCRUD 0.19.1 with better typing by @igorbenav in #217

⚡ FastCRUD 0.19.1 Type Safety Improvements

This release brings significant type safety enhancements through FastCRUD 0.19.1:

Before v0.16.0:

# Required manual casting due to union types
user = await crud_users.get(db=db, username="john", schema_to_select=UserRead)
user = cast(dict[str, Any], user)  # Manual cast needed! 😞
if user["tier_id"] is None:
    # ...

After v0.16.0:

# Direct type-safe access - no casting needed!
user = await crud_users.get(db=db, username="john", schema_to_select=UserRead)
if user["tier_id"] is None:  # Directly type-safe! 😍
    # ...

What This Means:

  • No More Manual Casting: Eliminated all cast(dict[str, Any], result) calls
  • Better IDE Support: Improved autocomplete and error detection
  • Cleaner Code: Removed 25+ unnecessary cast statements across the codebase
  • Type Safety: mypy now properly infers Optional[dict[str, Any]] for schema-based column selection

🏥 Health Check Endpoints

New health monitoring capabilities:

GET /health          # Basic health check
GET /health/detailed # Detailed system health with database status

Perfect for:

  • Load balancer health checks
  • Monitoring system integration
  • Container orchestration readiness probes

🎉 New Contributors

We're grateful to welcome these new contributors to the project:

🔗 Links

🚀 Migration Guide

For Existing Projects:

  1. Update Dependencies:

    # Update pyproject.toml
    fastcrud>=0.19.1
    
    # Sync dependencies
    uv sync
  2. Remove Manual Casts (if you added any):

    # Remove these patterns:
    user = cast(dict[str, Any], user)
    tier = cast(dict[str, Any], tier)
    
    # FastCRUD 0.19.1 overloads handle this automatically!
  3. Update Import Structure:

    # New import structure for pagination
    from fastcrud import PaginatedListResponse, compute_offset, paginated_response
  4. Run Tests:

    uv run pytest
    uv run mypy src/ --config-file pyproject.toml

Benefits You'll Get:

  • Better Type Safety: No more union types for common patterns
  • Cleaner Code: Removed casting boilerplate
  • Enhanced DX: Better IDE support and error detection
  • Future-Proof: Ready for FastCRUD's continued improvements

What's Changed

New Contributors

Full Changelog: v0.15.0...v0.16.0



Powered by Benav Labs - benav.io