supabase / postgrest-dart

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

Query ending: end() vs execute() #12

Closed m-kus closed 4 years ago

m-kus commented 4 years ago

Hey guys, great job with the postgrest libraries! I wonder what is the rationale behing choosing end() as the query ending instead of execute() which is already used in your Rust and Python libraries?
I think it makes more sense in a consistent syntax so that all the tutorials/examples are reusable for each new language supported.

phamhieu commented 4 years ago

I choose end() because it's the shortest verb I can think of to complete the query chain.

a consistent syntax so that all the tutorials/examples are reusable for each new language supported. It's a good point. Thanks @m-kus! I don't mind using execute() to have a consistent syntax.

What do you think? @kiwicopple

kiwicopple commented 4 years ago

a consistent syntax so that all the tutorials/examples are reusable for each new language supported.

100% on board with this.

It isn't actually required for JS, since the Promise is implicitly returned from the await, but for everything else we should try to map the syntax 1:1. It will be great if we can produce an reference docs which are consistent across all languages