SupabaseRemoteConfig<T, Id> class
Supabase-backed implementation of RemoteStore using PostgREST.
This adapter assumes a table schema that contains at least the following columns:
- id (text or uuid)
- updated_at (timestamptz, UTC)
- optional deleted_at (timestamptz, UTC) for soft delete
- scope_name (text)
- scope_keys (jsonb)
The adapter is backend-agnostic for the model T; callers provide JSON (de)serialization and ID mapping via the config object.
Constructors
-
SupabaseRemoteConfig.new({required SupabaseClient client, required String table, required String idColumn, required String updatedAtColumn, String? deletedAtColumn, required String scopeNameColumn, required String scopeKeysColumn, required Id idOf(T), required String idToString(Id), required Id idFromString(String), required Map<
String, dynamic> toJson(T), required T fromJson(Map<String, dynamic> ), void onParsePageStats({required int skipped, required int total})?, String? serverTimeRpcName, SyncScope? defaultScope, bool injectScopeOnWrite = false, Map<String, dynamic> scopeColumnsBuilder(SyncScope scope)?, SyncScope? scopeForUpsert(T item)?, SyncScope? scopeForDelete(Id id)?, Future<List< searchRunner(SupabaseSearchRequest plan)?})Map< >String, dynamic> > -
const
Properties
- client → SupabaseClient
-
final
- defaultScope → SyncScope?
-
Optional default scope used for write operations (upsert/delete) when
the backend cannot infer scope from auth context (e.g., RLS claims).
When provided and injectScopeOnWrite is true, this scope will be
injected into rows on upsert and used to filter delete operations.
final
- deletedAtColumn → String?
-
final
-
fromJson
→ T Function(Map<
String, dynamic> ) -
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- idColumn → String
-
final
- idFromString → Id Function(String)
-
final
- idOf → Id Function(T)
-
final
- idToString → String Function(Id)
-
final
- injectScopeOnWrite → bool
-
If true, write operations will inject or filter by scope using
defaultScope. Defaults to false.
final
- onParsePageStats → void Function({required int skipped, required int total})?
-
Optional hook to expose parse statistics for testing/observability.
Called after parsePage completes with the number of skipped rows and total rows.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
scopeColumnsBuilder
→ Map<
String, dynamic> Function(SyncScope scope)? -
Optional builder to construct scope columns map for writes.
If not provided, a default map using scopeNameColumn and scopeKeysColumn
with values from defaultScope is used.
final
- scopeForDelete → SyncScope? Function(Id id)?
-
Optional per-id scope selector for deletes when injectScopeOnWrite is true.
If provided and returns non-null, that scope will be used to filter the delete.
final
- scopeForUpsert → SyncScope? Function(T item)?
-
Optional per-item scope selector for upserts when injectScopeOnWrite is true.
If provided and returns non-null, that scope will be injected for the item.
final
- scopeKeysColumn → String
-
final
- scopeNameColumn → String
-
final
-
searchRunner
→ Future<
List< Function(SupabaseSearchRequest plan)?Map< >String, dynamic> > -
Optional runner to execute remoteSearch without hitting the network.
When provided,
remoteSearch
will call this runner with the built plan and expect a list of raw row maps in return. This is primarily for tests.final - serverTimeRpcName → String?
-
Optional RPC name to fetch authoritative server time (UTC).
If null, falls back to client-side time (not recommended).
final
- table → String
-
final
-
toJson
→ Map<
String, dynamic> Function(T) -
final
- updatedAtColumn → String
-
final
Methods
-
copyWith(
{SupabaseClient? client, String? table, String? idColumn, String? updatedAtColumn, String? deletedAtColumn, String? scopeNameColumn, String? scopeKeysColumn, Id idOf(T)?, String idToString(Id)?, Id idFromString(String)?, Map< String, dynamic> toJson(T)?, T fromJson(Map<String, dynamic> )?, void onParsePageStats({required int skipped, required int total})?, String? serverTimeRpcName, SyncScope? defaultScope, bool? injectScopeOnWrite, Map<String, dynamic> scopeColumnsBuilder(SyncScope scope)?, SyncScope? scopeForUpsert(T item)?, SyncScope? scopeForDelete(Id id)?, Future<List< searchRunner(SupabaseSearchRequest plan)?}) → SupabaseRemoteConfig<Map< >String, dynamic> >T, Id> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited