Skip to content

Conversation

@khawarizmus
Copy link

@khawarizmus khawarizmus commented Nov 19, 2025

Context

This PR revamps the PowerSync attachments documentation to provide clearer, more structured and consistent guidance for developers implementing file handling across all supported platforms.

Notable Changes

  • Added architecture workflow (11-step process from upload to cross-device sync)
  • Added attachment state reference table
  • Documented core concepts: Attachment Table, Storage Adapters, Attachment Queue
  • Reorganized implementation guide with multi-platform examples
  • Added advanced topics: error handling, custom adapters, cache management
  • Consolidated SDK/demo links into single reference table

TODOs

Code Examples:

  • Update JavaScript example code to use built-in package
  • Add a depraction note js and dart previous packages
  • Update Dart example code
  • Update Swift example code
  • Update Kotlin example code

Content Review:

  • Include the diagram
  • Revise the need for AWS S3 storage and PDF tutorials
  • Revise the need for Supabase handling attachment integration guide

Related PR implementation: powersync-ja/powersync-js#735

---
title: "Attachments / Files"
description: Syncing large attachments/files directly using PowerSync is not recommended.
description: Keep files out of your database and handle attachments in an entirely storage-agnostic way. PowerSync syncs minimal metadata while an offline-first queue automatically handles uploads, downloads, and retries.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should say "offline-first". Perhaps just "offline"?

Copy link
Author

@khawarizmus khawarizmus Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would make the Queue offline which is not the case. "Offline-first" here means that it's still going to behave fine offline and would automatically sync when back online just like how the rest of PowerSync does.

Copy link
Contributor

@stevensJourney stevensJourney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some minor comments, overall this doc is looks very well written and is a good guide for Attachments.

@khawarizmus khawarizmus marked this pull request as ready for review November 28, 2025 14:14

### Custom Storage Adapters

Create adapters for other storage systems:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be helpful if we can define "other" here - is it other to any of the examples we mention in the relevant sections above?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I have updated that section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants