supabase-community / postgrest-csharp

A C# Client library for Postgrest
https://supabase-community.github.io/postgrest-csharp/api/Postgrest.html
MIT License
114 stars 22 forks source link

Add specification of `shouldFilterTopLevel` (join type) to `ReferenceAttribute` #51

Closed acupofjose closed 1 year ago

acupofjose commented 1 year ago

Ref #50.

Adds embedType as constructor parameter for ReferenceAttribute with the default to EmbedQueryType.Inner to match current API expectations.

Example:

[Reference(typeof(Person), embedType: EmbedQueryType.Standard)]
public List<Person> Persons { get; set; }

Setting EmbedQueryType.Standard will remove Top Level Filtering from returned results.

See: https://postgrest.org/en/stable/api.html#embedded-filters

acupofjose commented 1 year ago

Update: As there are only two options, switch to boolean instead of enum: ShouldFilterTopLevel which defaults to true

Example:

[Reference(typeof(Person), shouldFilterTopLevel: false)]
public List<Person> Persons { get; set; }