AttachmentServiceImpl

open class AttachmentServiceImpl(db: PowerSyncDatabase, tableName: String, logger: Logger, maxArchivedCount: Long) : AttachmentService

Default implementation of AttachmentService.

This class provides the standard logic for interacting with local attachment records. Users can extend this class to customize the behavior for their specific use cases.

Constructors

Link copied to clipboard
constructor(db: PowerSyncDatabase, tableName: String, logger: Logger, maxArchivedCount: Long)

Functions

Link copied to clipboard
open override fun watchActiveAttachments(): Flow<Unit>

Watcher for changes to attachments table. Once a change is detected it will initiate a sync of the attachments

Link copied to clipboard
open suspend override fun <R> withContext(action: suspend (AttachmentContext) -> R): R

Executes a callback with an exclusive lock on all attachment operations. This helps prevent race conditions between different updates.