Recommended ORM for supabase + Dart Flutter
Hi all,
I’m building a Flutter app that will have some straightforward (one-to-many, many-to-many, etc.) but important relationships.
Setting up constraints and foreign keys etc. in the PostgreSQL database itself isn’t a big issue (though I would like to use migrations rather than write SQL scripts manually, for CI/CD purposes)
I’m trying to decide how to represent the models and relationships in the code. Is there a recommended Object-Relational Mapping package that will work with Dart and supabase? Does supabase have methods that encapsulate more complex queries? My other option is to write the methods myself and split them up between the models and the repositories, but I’d rather use an existing package for this if it saves time.
Some options I’ve seen in the community:
Thanks! :supafire:
I’m building a Flutter app that will have some straightforward (one-to-many, many-to-many, etc.) but important relationships.
Setting up constraints and foreign keys etc. in the PostgreSQL database itself isn’t a big issue (though I would like to use migrations rather than write SQL scripts manually, for CI/CD purposes)
I’m trying to decide how to represent the models and relationships in the code. Is there a recommended Object-Relational Mapping package that will work with Dart and supabase? Does supabase have methods that encapsulate more complex queries? My other option is to write the methods myself and split them up between the models and the repositories, but I’d rather use an existing package for this if it saves time.
Some options I’ve seen in the community:
- Prisma
- Dart Jaguar
- use the supabase built-in methods with custom PostgreSQL functions
- ActiveRecord (Ruby on Rails)
- Eloquent (PHP)
- mongoose (mongodb and Node.js)
Thanks! :supafire: