supabase / supabase-flutter

Flutter integration for Supabase. This package makes it simple for developers to build secure and scalable products.
https://supabase.com/
MIT License
661 stars 154 forks source link

Added some data retrieval methods to fetch data easily. #865

Closed Aniketkhote closed 3 months ago

Aniketkhote commented 3 months ago

What kind of change does this PR introduce?

feature

What is the current behavior?

To fetch single latest or oldest data currently need to apply order() on created_at field and then single() method to get one also to fetch null, true or false we need to pass in isFilter.

What is the new behavior?

latest() and oldest()

Before

final data = await supabase.from('users').select().order('created_at, ascending: true).single();

Now

final data = await supabase.from('users').select().latest(); or final data = await supabase.from('users').select().latest('id');

same for oldest.

isNull() , isTrue() and isFalse()

Before

final data = await supabase.from('users').select().isFilter('data', null);

Now

final data = await supabase.from('users').select().isNull('data'); or final data = await supabase.from('users').select().isTrue('data'); or final data = await supabase.from('users').select().isFalse('data');

dshukertjr commented 3 months ago

Thanks for the suggestion, but unfortunately we are not adding these new methods.