amplify_record_cache_dart library
Shared record caching infrastructure for Amplify streaming clients.
This package is internal to the Amplify Flutter monorepo and is not intended for direct use by customers.
Classes
- AutoFlushScheduler
- Manages automatic flush scheduling at a fixed interval.
- ClearCacheData
- Data returned from a clearCache operation.
- FlushData
- Data returned from a flush operation.
- FlushInterval
- A flush strategy that triggers automatic flushes at a fixed interval.
- FlushNone
- A flush strategy that disables automatic flushing.
- FlushStrategy
- Determines when automatic flushing of cached records occurs.
- InMemoryRecordStorage
- In-memory RecordStorage fallback for web when IndexedDB is unavailable. Records are not persisted.
- Record
- A record persisted in local storage, ready to be flushed to a streaming service (Kinesis Data Streams, Firehose, etc.).
- RecordCacheDatabase
- Drift database for managing cached records.
- RecordClient
- Orchestrates record operations: storage, sending, and retry logic.
- RecordData
- Data returned from a record operation.
- RecordInput
- A record to be persisted in the cache before sending.
- RecordStorage
- Abstract base class for record persistence.
- Sender
- Abstract interface for sending a batch of records to a streaming service.
- SendResult
- Result of a batch send operation.
- SqliteRecordStorage
- SQLite-backed RecordStorage implementation using Drift.
Constants
- defaultRecoverySuggestion → const String
- Default recovery suggestion for wrapped database errors.
Functions
-
createPlatformRecordStorage(
{required String identifier, required FutureOr< String> ? storagePath, required int maxCacheBytes, required int maxRecordsPerBatch, required int maxBytesPerBatch, required int maxRecordSizeBytes, required String dbPrefix, required String storeName}) → Future<RecordStorage> - Creates a platform-specific RecordStorage instance.
-
splitResults(
{required List< String?> errorCodes, required List<Record> records, required int maxRetries}) → SendResult - Splits a batch response into success/retry/fail buckets based on per-record error codes.
Exceptions / Errors
- RecordCacheDatabaseException
- Database operation failed.
- RecordCacheException
- Internal error type used by RecordClient / RecordStorage.
- RecordCacheLimitExceededException
- Cache limit exceeded — no space for new records.
- RecordCacheValidationException
- Record input validation failed (e.g. oversized record).