powersync_attachments_helper
0.7.0, released 7 months ago by powersync.com
Helper for syncing file attachments between local and remote storage in PowerSync apps
What it does
It queues uploads, downloads and deletes of files, watches database changes to enqueue work, and integrates with a remote storage adapter.
AI-written summary of version 0.7.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to keep media files in sync with a remote store while using PowerSync
- You want a simple queue that reacts to database changes
Skip it when
- You plan to use the upcoming core PowerSync attachments library
- You need advanced custom storage backends not supported by the helper
Strengths
- Built for PowerSync, handles queueing and watching DB changes
- Supports multiple platforms (Android, iOS, Windows, macOS, Linux)
- Uses standard Flutter plugins like path_provider
Weaknesses
- Will be replaced by core library, future features limited
- No support for custom local storage implementations
- Requires PowerSync 2.x
Setup
- Kind
- Flutter widgets
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 4
Add dependency, import package, implement AbstractRemoteStorageAdapter, initialize queue in main.dart
import 'package:powersync_attachments_helper/powersync_attachments_helper.dart';
class MyQueue extends AbstractAttachmentQueue {
MyQueue(db, remote) : super(db: db, remoteStorage: remote);
// implement saveFile, deleteFile, watchIds
}
initializeAttachmentQueue(db) async {
attachmentQueue = MyQueue(db, remoteStorage);
await attachmentQueue.init();
}
Works with
Packages commonly used together with powersync_attachments_helper: ones it builds on, ones built on it, and its own family.
- loggingpowersync_attachments_helper depends on itProvides configurable logging with levels and stream listeners for Dart apps.
- path_providerpowersync_attachments_helper depends on itProvides Flutter APIs to locate common filesystem directories on Android, iOS, macOS, Linux and Windows.
- sqlite3powersync_attachments_helper depends on itLightweight and convenient SQLite bindings for Dart using dart:ffi
- powersyncpowersync_attachments_helper depends on itPowerSync Dart and Flutter SDK. Sync Postgres, MongoDB, MySQL or SQL Server with SQLite in your app