mmvergara / supadart

Typesafe queries in Supabase Flutter! Generate Flutter / Dart 🎯 classes from your Supabase schema.
https://supadart.vercel.app
MIT License
43 stars 5 forks source link

Joining data and types #102

Open EmilAnkerstjerne opened 3 weeks ago

EmilAnkerstjerne commented 3 weeks ago

Is it possible to have typing on joined objects when you introduce joins into your supabase query?

If so, how Can I do that?

If not, is it Planned to be implemented?

mmvergara commented 2 weeks ago

Hi thanks for opening an issue. current way but you can do something like this, utilizing the generated .fromJson method

final author = Author.fromJson(related_table.author_id as Map<String, dynamic>);

I don't plan on implementing it, I think that the dart typing system isn't capable doing such thing yet.. and as far as i remember thats why the official supabase flutter sdk is yet to have a typing system just like in javascript (i think).