C# Reference v0.0

Fetch data

Performs vertical filtering with SELECT.

  • LINQ expressions do not currently support parsing embedded resource columns. For these cases, string will need to be used.
  • When using string Column Names to select, they must match names in database, not names specified on model properties.
  • Additional information on modeling + querying Joins and Inner Joins can be found in the postgrest-csharp README
  • By default, Supabase projects will return a maximum of 1,000 rows. This setting can be changed in Project API Settings. It's recommended that you keep it low to limit the payload size of accidental or malicious requests. You can use range() queries to paginate through your data.
  • From() can be combined with Modifiers
  • From() can be combined with Filters
  • If using the Supabase hosted platform apikey is technically a reserved keyword, since the API gateway will pluck it out for authentication. It should be avoided as a column name.

// Given the following Model (City.cs)
[Table("cities")]
class City : BaseModel
{
    [PrimaryKey("id")]
    public int Id { get; set; }

    [Column("name")]
    public string Name { get; set; }

    [Column("country_id")]
    public int CountryId { get; set; }

    //... etc.
}

// A result can be fetched like so.
var result = await supabase.From<City>().Get();
var cities = result.Models