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

Leverage LINQ while selecting columns from Table #58

Closed agwanyaseen closed 1 year ago

agwanyaseen commented 1 year ago

Feature request

Is your feature request related to a problem? Please describe.

Yes, Currently while selecting columns from database we have to pass column names as magic string comma sperated in Select method. This is error prone, even if we miss a letter unwillingly.

Describe the solution you'd like

We can leverage the linq while selecting columns (check below code for refrence)

var user = await client.Table<User>().Select(x => new { x.Username,x.Data }).Get();

Even if our column name changes in db table, we will have to just update the value in Column Attribute. It will also be provide type safety.

Describe alternatives you've considered

No alternative

Additional context


acupofjose commented 1 year ago

I'll look into this!

acupofjose commented 1 year ago

@agwanyaseen this is available in v3.1.0 - Thanks for the feature request!