Package-level declarations

Types

Link copied to clipboard
data class Attachment(val id: String, val timestamp: Long = 0, val filename: String, val state: AttachmentState = AttachmentState.QUEUED_DOWNLOAD, val localUri: String? = null, val mediaType: String? = null, val size: Long? = null, val hasSynced: Boolean = false, val metaData: String? = null)

Represents an attachment with metadata and state information.

Link copied to clipboard

Context for performing Attachment operations. This typically is provided through a locking/exclusivity method.

Link copied to clipboard
open class AttachmentQueue(val db: PowerSyncDatabase, val remoteStorage: RemoteStorage, attachmentsDirectory: String, watchAttachments: () -> Flow<List<WatchedAttachmentItem>>, val localStorage: LocalStorage = IOLocalStorageAdapter(), attachmentsQueueTableName: String = DEFAULT_TABLE_NAME, errorHandler: SyncErrorHandler? = null, syncInterval: Duration = 30.seconds, archivedCacheLimit: Long = 100, syncThrottleDuration: Duration = 1.seconds, subdirectories: List<String>? = null, downloadAttachments: Boolean = true, val logger: Logger = Logger, coroutineScope: CoroutineScope? = null)

Class used to implement the attachment queue. Requires a PowerSyncDatabase, an implementation of AbstractRemoteStorageAdapter, and an attachment directory name which will determine which folder attachments are stored into.

Link copied to clipboard

Service for interacting with the local attachment records.

Link copied to clipboard

Represents the state of an attachment.

Link copied to clipboard
interface LocalStorage

Provides access to local storage on a device.

Link copied to clipboard
interface RemoteStorage

Adapter for interfacing with remote attachment storage.

Link copied to clipboard

Interface for handling errors during attachment operations. Implementations determine whether failed operations should be retried. Attachment records are archived if an operation fails and should not be retried.

Link copied to clipboard
data class WatchedAttachmentItem(val id: String, val fileExtension: String? = null, val filename: String? = null, val metaData: String? = null)

A watched attachment record item. This is usually returned from watching all relevant attachment IDs.

Functions

Link copied to clipboard

Creates a PowerSync table for storing local attachment state.