INSERT, UPDATE, or DELETE statements. PowerSync automatically queues these writes and uploads them to your backend via the uploadData() function in your backend connector.
Basic Write Operations
Best practice: Use UUIDs when inserting new rows on the client side. UUIDs can be generated offline/locally, allowing for unique identification of records created in the client database before they are synced to the server. See Client ID for more details.
ORM Support
PowerSync integrates with popular ORM libraries, which provide type safety and additional tooling. Using an ORM is often preferable to writing raw SQL queries, especially for common operations. See ORM Support to learn which ORMs PowerSync supports and how to get started.Write Operations and Upload Queue
PowerSync automatically queues writes and uploads them to your backend. The upload queue stores three types of operations:| Operation | Purpose | Contents | SQLite Statement |
|---|---|---|---|
PUT | Create new row | Contains the value for each non-null column | Generated by INSERT statements. |
PATCH | Update existing row | Contains the row id, and value of each changed column. | Generated by UPDATE statements. |
DELETE | Delete existing row | Contains the row id | Generated by DELETE statements. |
Advanced Topics
- Usage Examples - Code examples for common use cases