pocketbase_drift 0.2.1
pocketbase_drift: ^0.2.1 copied to clipboard
A powerful, offline-first PocketBase client backed by a drift database.
0.2.1 #
Exclude certain API paths from caching in send
method
- Add a list of non-cacheable path segments to exclude specific API endpoints from being cached.
- Modify the send method to bypass cache if the request path contains any of these segments.
This prevents caching sensitive or system data like backups, settings, and logs.
0.2.0 #
Refactor file download methods to use consistent getFileData & Implement auto-generation of file token
- Change token parameter from bool to String?
- Add autoGenerateToken parameter to automatically generate tokens when needed
- Refactor file download methods to use consistent getFileData API across platforms
- Improve file service architecture to better handle token-based file downloads
0.1.2 #
- Update Documentation.
0.1.1 #
- Resolve pub.flutter-io.cn score issues e.g outdated plugin dependencies.
0.1.0 #
- Initial release.
This is the first version of pocketbase_drift
, a powerful offline-first client for the PocketBase backend, built on top of the reactive persistence library Drift.
Features #
- Offline-First Architecture: Read, create, update, and delete records even without a network connection. The client seamlessly uses the local database as the source of truth.
- Automatic Synchronization: Changes made while offline are automatically queued and retried when network connectivity is restored.
- Reactive Data & UI: Build reactive user interfaces with streams that automatically update when underlying data changes, whether from a server push or a local mutation.
- Local Caching with Drift: All collections and records are cached in a local SQLite database, providing fast, offline access to your data.
- Powerful Local Querying: Full support for local querying, mirroring the PocketBase API. This includes:
- Filtering: Complex
filter
strings are parsed into SQLiteWHERE
clauses. - Sorting: Sort results by any field with
sort
(e.g.,-created,name
). - Field Selection: Limit the returned fields with
fields
for improved performance. - Pagination:
limit
andoffset
are fully supported for local data.
- Filtering: Complex
- Relation Expansion: Support for expanding single and multi-level relations (e.g.,
post.author
) directly from the local cache. - Full-Text Search: Integrated Full-Text Search (FTS5) for performing fast, local searches across all your cached record data.
- Authentication Persistence: User and admin authentication state is persisted locally using
shared_preferences
, keeping users logged in across app sessions. - Cross-Platform Support: Works across all Flutter-supported platforms, including mobile (iOS, Android), web, and desktop (macOS, Windows, Linux).
- Basic File & Image Caching: Includes a
PocketBaseImageProvider
that caches images in the local database for offline display. - Custom API Route Caching: Added support for offline caching of custom API routes accessed via the
send
method. This allowsGET
requests to custom endpoints to be cached and available offline, improving performance and reliability for custom integrations. - Robust & Performant: Includes optimizations for batching queries and file streaming on all platforms to handle large files efficiently.
Improvements #
- Improved maintainability by refactoring the large
create
andupdate
methods in the internalServiceMixin
into smaller, more manageable helper methods. - Improved web performance by switching from a full
http.get()
to a streaming download for file fetching, aligning it with the more memory-efficient native implementation.