Skip to content

TechMagister/supabase-client

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stage: Alpha

Integrate your Supabase projects with C#.

Includes C# features to make supabase function more like an ORM - specifically the ability to leverage strongly typed models.

Inspired by and reuse the code from :

Why this project and not Supabase-client ?

  • Remove singletons
  • Allow better integration with DI
  • Use nullable everywhere
  • Use System.Text.Json instead of Newtonsoft (except when it's not possible)

Status

  • Integration with GoTrue
  • Integration with Postgrest
  • Integration with Realtime
  • Integration with Storage
  • Integration with Edge Functions
  • Nuget Release

Getting Started

Getting started will be pretty easy, allowing dependencies injection.

Sample usage can be found here : TechMagister/SupaAppTemplate

@TODO

Models:

Supabase-client is heavily dependent on Models deriving from BaseModel). To interact with the API, one must have the associated model specified.

Leverage Table,PrimaryKey, and Column attributes to specify names of classes/properties that are different from their C# Versions.

[Table("messages")]
public class Message : SupabaseModel
{
    // `ShouldInsert` Set to false so-as to honor DB generated key
    // If the primary key was set by the application, this could be omitted.
    [PrimaryKey("id", false)]
    public int Id { get; set; }

    [Column("username")]
    public string UserName { get; set; }

    [Column("channel_id")]
    public int ChannelId { get; set; }
}

Contributing

We are more than happy to have contributions! Please submit a PR.

About

A C# Client library for Supabase

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 96.5%
  • PLpgSQL 3.5%