Interface IPostgrestClient
- Namespace
- Supabase.Postgrest.Interfaces
- Assembly
- Supabase.Postgrest.dll
Client interface for Postgrest
public interface IPostgrestClient : IGettableHeaders
- Inherited Members
-
IGettableHeaders.GetHeaders
Properties
BaseUrl
API Base Url for subsequent calls.
string BaseUrl { get; }
Property Value
Options
The Options Client was initialized with.
ClientOptions Options { get; }
Property Value
Methods
AddDebugHandler(DebugEventHandler)
Adds a debug handler
[Obsolete("The debug handler is replaced by OpenTelemetry-compatible diagnostics: subscribe to the ActivitySource and Meter named \"Supabase.Postgrest\". This member will be removed in a future major version.")]
void AddDebugHandler(IPostgrestDebugger.DebugEventHandler handler)
Parameters
handlerIPostgrestDebugger.DebugEventHandler
AddRequestPreparedHandler(OnRequestPreparedEventHandler)
Adds a handler that is called prior to a request being sent.
void AddRequestPreparedHandler(OnRequestPreparedEventHandler handler)
Parameters
handlerOnRequestPreparedEventHandler
Attach<T>(T)
Attaches this client's context (BaseUrl, RequestClientOptions,
and its headers callback) to a model, so that Update/Delete can be called directly on the
model afterward.
Intended for models that were deserialized by something other than this client's own Table<T>
responses (which already attach this context automatically) - for example, a model deserialized from a
Realtime event.
T Attach<T>(T model) where T : BaseModel
Parameters
modelTThe model to attach context to. Mutated in place and also returned for chaining.
Returns
- T
The same model instance, for convenience.
Type Parameters
TCustom Model derived from
BaseModel
ClearDebugHandlers()
Clears debug handlers
[Obsolete("The debug handler is replaced by OpenTelemetry-compatible diagnostics: subscribe to the ActivitySource and Meter named \"Supabase.Postgrest\". This member will be removed in a future major version.")]
void ClearDebugHandlers()
ClearRequestPreparedHandlers()
Clears all OnRequestPreparedEventHandler handlers.
void ClearRequestPreparedHandlers()
RemoveDebugHandler(DebugEventHandler)
Removes a debug handler
[Obsolete("The debug handler is replaced by OpenTelemetry-compatible diagnostics: subscribe to the ActivitySource and Meter named \"Supabase.Postgrest\". This member will be removed in a future major version.")]
void RemoveDebugHandler(IPostgrestDebugger.DebugEventHandler handler)
Parameters
handlerIPostgrestDebugger.DebugEventHandler
RemoveRequestPreparedHandler(OnRequestPreparedEventHandler)
Removes an OnRequestPreparedEventHandler handler.
void RemoveRequestPreparedHandler(OnRequestPreparedEventHandler handler)
Parameters
handlerOnRequestPreparedEventHandler
Rpc(string, object?)
Perform a stored procedure call.
Task<BaseResponse> Rpc(string procedureName, object? parameters)
Parameters
procedureNamestringThe function name to call
parametersobjectThe parameters to pass to the function call
Returns
Rpc<TModeledResponse>(string, object?)
Perform a stored procedure call.
Task<TModeledResponse?> Rpc<TModeledResponse>(string procedureName, object? parameters = null)
Parameters
procedureNamestringThe function name to call
parametersobjectThe parameters to pass to the function call
Returns
- Task<TModeledResponse>
A hydrated model
Type Parameters
TModeledResponseA type used for hydrating the HTTP response content (hydration through JSON.NET)
Table<T>()
Returns a Table Query Builder instance for a defined model - representative of USE $TABLE
IPostgrestTable<T> Table<T>() where T : BaseModel, new()
Returns
Type Parameters
TCustom Model derived from
BaseModel
Table<T>(IPostgrestCacheProvider)
Returns a Table Query Builder instance with a Cache Provider for a defined model - representative of USE #$TABLE
IPostgrestTableWithCache<T> Table<T>(IPostgrestCacheProvider cacheProvider) where T : BaseModel, new()
Parameters
cacheProviderIPostgrestCacheProvider
Returns
Type Parameters
T