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.
Client is no longer a singleton class.
StatelessClient has been removed as Client performs the same essential functions.
Table default constructor requires reference to JsonSerializerSettings
BaseModel now keeps track of BaseUrl and RequestClientOptions. These are now used in the default (and overridable) BaseModel.Update and BaseModel.Delete methods (as they previously referenced the singleton).
All publicly facing classes (that offer functionality) now include an Interface.
RequestException is no longer thrown for attempting to update a record that does not exist, instead an empty ModeledResponse is returned.
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();
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.
Client
is no longer a singleton class.StatelessClient
has been removed asClient
performs the same essential functions.Table
default constructor requires reference toJsonSerializerSettings
BaseModel
now keeps track ofBaseUrl
andRequestClientOptions
. These are now used in the default (and overridable)BaseModel.Update
andBaseModel.Delete
methods (as they previously referenced the singleton).RequestException
is no longer thrown for attempting to update a record that does not exist, instead an emptyModeledResponse
is returned.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.)