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

Restructure Project to support DI and enable Nullity #54

Closed acupofjose closed 1 year ago

acupofjose commented 1 year ago

This pull represents a restructuring of the entire project to support Dependency Injection and Nullability (ref: supabase-community/supabase-csharp#34 and #53). Unfortunately this introduces some breaking API changes.

In reality, not much should affect the developer as most of these classes/methods are only being referenced internally by the Client. The removal of the Singleton aspect may offer some design changes for those leveraging this library by itself (as opposed to using it only in supabase-csharp.)

// What was:
var client = Client.Initialize(baseUrl, options);
var query = await client.Table<User>.Single();

// Becomes:
var client = new Client(baseUrl, options);
var query = await client.Table<User>.Single();
acupofjose commented 1 year ago

Fixes #53