cunybpl / aiodal

async data access layer and related tools for sqlalchemy core
0 stars 0 forks source link

Bringing in `views` for API usage #16

Closed bsnacks000 closed 11 months ago

bsnacks000 commented 11 months ago

We have a set of wrappers that are used in our fastapi endpoints currently as views.py.

These would be useful to have in aiodal so that they can be reused for other packages but I do not want to bring in fastapi as a dependency to aiodal in the same way I do not want to bring in pydantic to this lib.

I think if we take the view classes and replace the exceptions with a common exception that exposes the same fields as a fastapi HttpException then we can easily handle these in the fastapi app with an @app decorator.