-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Idea: Using Query Builder / ORM for database access like SQLAlchemy or Peewee #137
Comments
Sorry to have u waiting for few weeks! busy for the bottom of the year. i am very appreciated for your instructive suggestion.
you are definitely right dude! i did find the discussion about
in short, the following works:
your ideas do help a lot! |
NP thanks for the thoughtful response and research Atticuszz! Good point +1, yes for a Fastapi library like yours sqlmodel w/ sqlacodegen feels like the best integration, (Just rambling lol) That said, this is just an idea, thanks again for putting this repo together! |
Hey, I really appreciate your thoughtful response about adding SQLModel to the template. You've made an excellent point about the timing - this early stage of template development is indeed the perfect moment to make such a foundational decision. I've been pondering your input, and I think you're right that this is a good direction to explore. However, I'd like to suggest a slightly different approach that might offer even more flexibility: What if we use Supabase primarily as a database UI tool, while handling core database operations through SQLModel? This way, we get the best of both worlds - Supabase's excellent admin interface, and SQLModel's versatility for actual data interactions. SQLModel is particularly appealing because it supports both object-oriented and SQL-like query syntax. This flexibility could be crucial for a template meant to serve various project needs. Plus, with async support on their roadmap, it seems like a forward-thinking choice. I believe this approach could provide a more universal and adaptable foundation, without tying us too closely to any single ecosystem. |
it starts on #143 now ,coming soon together with self-host supabase and sqlmodel orm 😆 |
Is your feature request related to a problem? Please describe.
Thanks for putting this together!
One thing which annoys me about Supabase-Py is the lack of Query Builder / ORM which feels like makes the queries fragile OR you have to have a full CRUD test for it.
Describe the solution you'd like
Did you consider generating models out of the Postgres Database with say sqlacodegen?
I.e. instead of doing
you could with SQLAlchemy or Peewee ORMs do like:
which catches query problems at build time.
Describe alternatives you've considered
Current solution feels good enough.
Additional context
I have started executing on this idea with Peewee, but it ain't yet fully production ready. Just wanted to give you an idea
https://github.com/petercsiba/supawee?tab=readme-ov-file#example-models
The text was updated successfully, but these errors were encountered: