Skip to content

Releases: awtkns/fastapi-crudrouter

v0.8.6 - Python 3.11 Support

28 Jan 08:54
9b82986
Compare
Choose a tag to compare

🎉 Highlights

With the release of v0.8.6 fastapi-crudrouter now officially supports both Python 3.11 and has dropped official support for Python 3.6 . Keep an eye of for the next release (v.0.9) which will contain support for async SQLAlchemy (#122).

Big thanks to all contributors that made this possible!

✨ Features

🐛 Bugs

  • Fix deployment pipeline by @awtkns in #180
  • Fix docker-compose reference in contributing documentation by @daxxog in #170

💛 New Contributors

Full Changelog: v0.8.5...v0.8.6

v0.8.5 - Typing

27 Jan 06:55
Compare
Choose a tag to compare

🎉 Highlights

With the release of v0.8.5 fastapi-crudrouter now officially supports both Python 3.10 and typed python. This release also includes significant improvements to the documentation, test suite, and developer experience.

Keep an eye of for the next release which will contain support for async SQLAlchemy (#122).

Big thanks to all contributors that made this possible!

✨ Features

🐛 Bug Fixes

  • OrderBy not working correctly with Microsoft SQL Server #88
  • 404 response not documented in OpenAPI spec #104 @sondrelg
  • DatabasesCRUDRouter not functioning for inserts and deletes with AsyncPG #98

Full Changelog: v0.8.0...v0.8.5

v0.8.0 - Gino Backend

07 Jul 04:49
1711d00
Compare
Choose a tag to compare

🎉 Highlights

With the release of v0.6.0 fastapi-crudrouter now supports Gino as an async backend! When generating routes, GinoCRUDRouter will automatically tie into your database using your Gino models. To use it, simply pass your Gino database model, a database reference, and your pydantic.

GinoCRUDRouter(
    schema=MyPydanticModel,
    db_model=MyModel, 
    db=db
)

Check out the docs for more details on how to use the GinoCRUDRouter.

✨ Features

🐛 Bug Fixes

  • All Path Prefixes are now correctly lowercase #64 #65

v0.7.0 - Advanced Dependencies

18 Apr 23:07
48e5541
Compare
Choose a tag to compare

🎉 Highlights

With the release of v0.7.0 fastapi-crudrouter now provides the ability to set custom dependencies on a per route basis; a much requested feature. Prior to this release, it was only possible to set dependencies for all the routes at once.

MemoryCRUDRouter(
    schema=MySchema,
    create_route=[Depends(user)],
    delete_all_route=[Depends(admin)]
)

Shown above is a brief example on how limiting each route to specific access rights would work using this new feature. Check out the docs for more details.

✨ Features

v0.6.0 - Ormar Backend

26 Mar 18:38
Compare
Choose a tag to compare

🎉 Highlights

With the release of v0.6.0 fastapi-crudrouter now supports ormar as an async backend! When generating routes, the OrmarCRUDRouter will automatically tie into your database using your ormar models. To use it, simply pass your ormar database model as the schema.

OrmarCRUDRouter(
    schema=MyPydanticModel, 
    paginate=25
)

Check out the docs for more details on how to use the OrmarCRUDRouter.

✨ Features

  • Full Ormar Support @collerek #46
  • Better handling of database errors in the update route @sorXCode #48
  • Improved typing #46 #43
  • Black, Flake8 and Mypy linting #46
  • Additional Tests for nested models #40

🐛 Bug Fixes

  • Pagination issues when max limit was set to null @EthanHaid #42

v0.5.0 - Pagination

07 Mar 04:43
36eaa63
Compare
Choose a tag to compare

🎉 Highlights

With the release of v0.5.0 all CRUDRouters now supports pagination. All "get all" routes now accept skip and limit query parameters allowing you to easily paginate your routes. By default, no limit is set on the number of items returned by your routes. Should you wish to limit the number of items that a client can request, it can be done as shown below.

CRUDRouter(
    schema=MyPydanticModel, 
    paginate=25
)

Check out the docs on pagination for more information!

✨ Features

🐛 Bug Fixes

  • Prefixing not available for versions of fastapi below v0.62.0 #29 #30
  • Fixed an Import Issue SQLAlchemy and Integrity Errors @andreipopovici #33

v0.4.0 - Tortoise ORM Support

02 Feb 04:03
Compare
Choose a tag to compare

✨Features

  • Full support for tortoise-orm #24
  • Dynamic pk/id types for get_one, delete_one, and update_one routes #26

🐛 Bug Fixes

  • Fixed the summary for the delete one route #16
  • Fixed import errors when certain packages are not installed #21
  • Improved SQLA type hinting

v0.3.0 - Initial Release

04 Jan 05:00
Compare
Choose a tag to compare

🎉 Initial Release 🎉

Tired of rewriting the same generic CRUD routes? Need to rapidly prototype a feature for a presentation or a hackathon? Thankfully, fastapi-crudrouter has your back. As an extension to the APIRouter included with FastAPI, the FastAPI CRUDRouter will automatically generate and document your CRUD routes for you.

Documentation: https://fastapi-crudrouter.awtkns.com

Source Code: https://github.com/awtkns/fastapi-crudrouter

Installation

pip install fastapi_crudrouter

Usage

Below is a simple example of what the CRUDRouter can do. In just ten lines of code, you can generate all the crud routes you need for any model. A full list of the routes generated can be found here.

from pydantic import BaseModel
from fastapi import FastAPI
from fastapi_crudrouter import MemoryCRUDRouter as CRUDRouter

class Potato(BaseModel):
    id: int
    color: str
    mass: float

app = FastAPI()
app.include_router(CRUDRouter(model=Potato))

Features

  • Automatic pydantic model based route generation and documentation (Docs)
  • Ability to customize any of the generated routes (Docs)
  • Authorization and FastAPI dependency support (Docs)
  • Support for both async and non-async relational databases using SQLAlchemy (Docs)
  • Extensive documentation.
  • And much more 😎