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:
  • Prisma
  • Dart Jaguar
  • use the supabase built-in methods with custom PostgreSQL functions
ORMs/ODMs with which I’m familiar from other projects:
  • ActiveRecord (Ruby on Rails)
  • Eloquent (PHP)
  • mongoose (mongodb and Node.js)
Is there enough out of the box with supabase to just use the built-in methods and add my own model methods and repositories, or is there an ORM that pairs well with supabase and Flutter? Do we have best practices around this yet?

Thanks! :supafire:
Was this page helpful?