supabase / postgrest-dart

Dart client for PostgREST
https://supabase.com
MIT License
136 stars 38 forks source link

fix: Add support for filter on rpc #44

Closed dshukertjr closed 3 years ago

dshukertjr commented 3 years ago

What kind of change does this PR introduce?

Currently filters such as eq or neq are not supported on rpc() call within this package. If we take a look at postgrest-js, it is supported.

This is because rpc() on postgrest-js returns PostgrestFilterBuilder where as rpc() on postgrest-dart returns PostgrestTransformBuilder, which does not have the methods for filters.

What is the current behavior?

rpc() returns PostgrestTransformBuilder, which does not have the methods for filters.

What is the new behavior?

rpc() returns PostgrestFilterBuilder, which does not have the methods for filters.

Additional context

I added one test that is the same as the one found in supabase-js.

@phamhieu I was wondering if there was a specific reason why rpc() on postgrest-dart returns PostgrestTransformBuilder and not PostgrestFilterBuilder like postgrest-js, but do you have any additional context here?

dshukertjr commented 3 years ago

Thanks! Let me bump up the version number now. I also want Pham to take a look at this just in case there was a special reason why postgrest-dart was designed this way!

phamhieu commented 3 years ago

Thanks! Let me bump up the version number now. I also want Pham to take a look at this just in case there was a special reason why postgrest-dart was designed this way!

I missed that part when starting this lib. Great work put it in thanks @dshukertjr