supabase / postgrest-js

Isomorphic JavaScript client for PostgREST.
https://supabase.com
MIT License
956 stars 127 forks source link

Support nulls=stripped introduced by PostgREST 11.2.0 #460

Open steve-chavez opened 10 months ago

steve-chavez commented 10 months ago

PostgREST 11.2.0 introduced stripping of null value properties in JSON results for arrays and single object responses. To support that functionality in postgrest-js a method like stripNulls()could be introduced. For instance: client.from('table').select().stripNulls().

Further information:

https://github.com/PostgREST/postgrest/releases/tag/v11.2.0 (see "Resource Representation") https://postgrest.org/en/stable/references/api/resource_representation.html#stripped-nulls https://github.com/PostgREST/postgrest/blob/main/test/spec/Feature/Query/NullsStrip.hs

https://github.com/PostgREST/postgrest/issues/1601 https://github.com/PostgREST/postgrest/pull/2894 https://github.com/PostgREST/postgrest/pull/2899

Originally posted by @vrilcode in https://github.com/supabase/supabase/discussions/16479

imageck commented 10 months ago

Great addition. Thank you for the continuous improvement and maintenance.

My two cents: I would also like if it could be set as a global option.