mrevutskyi / flask-restless-ng

A Flask extension for creating simple ReSTful JSON APIs from SQLAlchemy models.
https://flask-restless-ng.readthedocs.io
Other
64 stars 11 forks source link

Integration w Prisma #39

Closed reubano closed 1 year ago

reubano commented 1 year ago

Just spitballing here, but it would be great if this could work with the Prisma ORM. While I'm a huge fan of SQLAlchemy, Prisma integration would open the door to using the Prisma Studio (and potentially Supabase Studio) admin interface.

I'm sure this is out of scope for this project, but a pluggable ORM would be killer.

Edit. My inspiration for this issue is A beginners guide to building a Flask API with Prisma which has a ton of API routing boilerplate that could be eliminated with the above idea.

mrevutskyi commented 1 year ago

Thank you for the suggestion. I'm afraid that Prisma and SQLAlchemy use very different approaches, and SQLAlchemy is too tightly integrated in the flask-restless architecture. I like the idea of pluggable ORM/engines, and even played with it a little a while ago. But it would be easier to start a new project from scratch, than try to re-design this one, as it would break the existing API anyway. Unfortunately I only have time to maintain the existing API and dependencies, and that is too big of a project

reubano commented 1 year ago

@mrevutskyi I figured as much. Can you point me in the right direction if I ever decide to take something like this on myself? What tips/suggestions do you have from your exploration?

mrevutskyi commented 1 year ago

Not sure I have actual practical tips, just general ideas that I was thinking :) My plan was to develop two main interfaces:

  1. For input/db access (e.g. SQLAlchemy, Prisma, etc.)
  2. For output/serialization (e.g JSON:API, other specifications)

Plus interfaces to customize search parameters