powersync library

PowerSync with Encryption for Flutter.

Use PowerSyncSQLCipherOpenFactory to open an encrypted database.

Classes

Column
A single column in a table schema.
CrudBatch
A batch of client-side changes.
CrudEntry
A single client-side change.
CrudTransaction
DevConnector
Connects to the PowerSync service in development mode.
DevCredentials
Credentials used to connect to the PowerSync dev API.
Index
IndexedColumn
Describes an indexed column.
PendingStatement
An SQL statement to be run by the sync client against raw tables.
PendingStatementValue
A description of a value that will be resolved in the sync client when running a PendingStatement for a RawTable.
PowerSyncBackendConnector
Implement this to connect an app backend.
PowerSyncCredentials
Temporary credentials to connect to the PowerSync service.
PowerSyncDatabase
A PowerSync managed database.
PowerSyncOpenFactory
PowerSyncSQLCipherOpenFactory
A factory for opening a database with SQLCipher encryption. An encryption key is required to open the database.
ProgressWithOperations
Information about a progressing download.
RawTable
A raw table, defined by the user instead of being managed by PowerSync.
Schema
The schema used by the database.
SyncOptions
Options that affect how the sync client connects to the sync service.
SyncStatus
SyncStream
A handle to a SyncStreamDescription that allows subscribing to the stream.
SyncStreamDescription
A description of a sync stream, consisting of its name and the parameters used when subscribing.
SyncStreamStatus
Current information about a SyncStream that the sync client is subscribed to.
SyncStreamSubscription
SyncStream that has been subscribed to.
SyncSubscriptionDescription
Information about a subscribed sync stream.
Table
A single table in the schema.
TrackPreviousValuesOptions
Options to include old values in CrudEntry for update statements.
UploadQueueStats
Stats of the local upload queue.

Enums

ColumnType
Type of column.
SyncClientImplementation
The PowerSync SDK offers two different implementations for receiving sync lines: One handling most logic in Dart, and a newer one offloading that work to the native PowerSync extension.
UpdateType
Type of local change.

Extension Types

StreamPriority
The priority of a PowerSync stream.
SyncDownloadProgress
Provides realtime progress on how PowerSync is downloading rows.

Properties

attachedLogger → Logger
Standard logger. Does not automatically log to the console, use the Logger.root.onRecord stream to get log messages.
final
autoLogger → Logger
Logger that outputs to the console in debug mode, and nothing in release and profile modes.
final
debugLogger → Logger
Logger that always outputs debug info to the console.
final
uuid → Uuid
final

Typedefs

BucketPriority = StreamPriority
SyncPriorityStatus = ({bool? hasSynced, DateTime? lastSyncedAt, StreamPriority priority})
Partial information about the synchronization status for buckets within a priority.

Exceptions / Errors

CredentialsException
This indicates an error with configured credentials.
PowersyncNotReadyException
PowerSyncProtocolException
An internal protocol exception.
SyncResponseException
An error that received from the sync service.