SupabaseReplicator<I> class

A replicator provider that synchronizes collections with a Supabase PostgreSQL backend.

Inheritance

Constructors

SupabaseReplicator(Collection<I> _collection, SyncQueue syncQueue, SupabaseClient client, String pgmqTableName, {String pgmqSchemaName = defaultPgmqSchemaName, Future<bool> hasConnection()?, SyncTriggerPolicy triggerPolicy = defaultSyncTriggerPolicy})

Properties

client → SupabaseClient
The Supabase client connection instance.
final
collection → Collection<I>
no setterinherited
ensureInitialized → Future<void>
Released when initializedSuccessfully is called. If initializedWithError is called, throws the given exception.
no setterinherited
failResolver → FailResolver?
Defines how to resolve fails as data conflicts between local and remote versions.
finalinherited
hasConnection → Future<bool> Function()?
Optional callback check if a network connection is active.
final
hashCode → int
The hash code for this object.
no setterinherited
isInitialized → bool
Simply checks if the object is initialized at the moment.
no setterinherited
pgmqSchemaName → String
The Postgres schema name of the queue log tables (default is 'public').
final
pgmqTableName → String
The name of the pgmq table to sync with (defaults to collection name + _queue_log).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
syncQueue → SyncQueue
The sync queue that stores data changes and download occurrences.
finalinherited
triggerPolicy ↔ SyncTriggerPolicy
Defines the trigger policy that dictates the conditions of time or volume to execute the data push.
getter/setter pairinherited
whenInitialized → Stream<void>
Fired when initializedSuccessfully is called. If initializedWithError is called, the given exception is passed to the onError callback.
no setterinherited
whenUninitialized → Stream<void>
Fired when markAsUninitialized is called.
no setterinherited

Methods

dispose() → void
Disposes the replicator and releases any resources.
override
getSyncPointers() → Future<SyncPointers>
Get/calculate the current state of the local and remote synchronization pointers.
override
initializedSuccessfully() → void
Marks that the object has been initialized successfully.
inherited
initializedWithError({Object? error, String? message, StackTrace? stackTrace}) → void
Marks that the object was initialized with an error.
inherited
markAsUninitialized() → void
Marks that the object is again not initialized. After this, you can call initializedSuccessfully again.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onCollectionChanged(DataTransfer dataTransfer) → Future<void>
Publishes collection changes to the persistence layer.
override
pull() → Future<void>
Pull changes from server by last know state.
override
push() → Future<void>
Push changes to server by consolidating pending changes in a consolidated and resilient manner.
override
reinitialize(Future future(), {bool callInitializedWithErrorOnException = true}) → Future
Allows to reinitialize the object with the call of the given future.
inherited
sync() → Future<void>
Pull changes from server and push changes to server.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

builder<C>(SyncQueue syncQueue, SupabaseClient client, String pgmqTableName, {String pgmqSchemaName = defaultPgmqSchemaName, Future<bool> hasConnection()?, SyncTriggerPolicy syncTriggerPolicy = defaultSyncTriggerPolicy}) → SupabaseReplicator<C> Function(Collection<C>)