Configure your backend database for PowerSync, including permissions and replication settings.
powersync
logical replication publicationSupabase
SELECT
privilege, and for the publication mentioned in the next step (as well as for any other publications that may exist).AWS RDS
rds.logical_replication
parameter to 1
in the parameter group for the instance:SELECT
privilege, and for the publication (as well as for any other publications that may exist).Azure Postgres
SELECT
privilege, and for the publication mentioned in the next step (as well as for any other publications that may exist).Google Cloud SQL
SELECT
privilege, and for the publication mentioned in the next step (as well as for any other publications that may exist).Neon
SELECT
privilege, and for the publication mentioned in the next step (as well as for any other publications that may exist).Fly Postgres
SELECT
privilege, and for the publication mentioned in the next step (as well as for any other publications that may exist).PlanetScale
wal_level = logical
) enabled by default.SELECT
privilege, and for the publication mentioned in the next step (as well as for any other publications that may exist).Other / Self-hosted
wal_level = logical
in your config file:SELECT
privilege, and for the publication mentioned in the next step (as well as for any other publications that may exist).changeStreamPreAndPostImages
on replicated collections (the default for new PowerSync instances), additionally add the dbAdmin
permission:
listCollections
: This privilege must be granted on the database being replicated.find
: This privilege must be granted either at the database level or on specific collections.changeStream
: This privilege must be granted at the database level (not on individual collections). In MongoDB Atlas, set collection: ""
or check Apply to any collection
in MongoDB Atlas if you want to apply this privilege on any collection.
db: ""
or check Apply to any database
in MongoDB Atlas._powersync_checkpoints
collection add the following privileges: createCollection
, dropCollection
, find
, changeStream
, insert
, update
, and remove
changeStreamPreAndPostImages
on
replicated collections, additionally add the collMod
permission on the database and all collections being replicated.changeStreamPreAndPostImages
option to be enabled on replicated collections.
PowerSync supports three configuration options for post-images:
post_images: off
): Uses fullDocument: 'updateLookup'
for backwards compatibility. This was the default for older instances. However, this may lead to consistency issues, so we strongly recommend enabling post-images instead.post_images: auto_configure
) The default for new instances: Automatically enables the changeStreamPreAndPostImages
option on collections as needed. Requires the permissions/privileges mentioned above. If a collection is removed from Sync Rules, developers can manually disable changeStreamPreAndPostImages
.post_images: read_only
): Uses fullDocument: 'required'
and requires changeStreamPreAndPostImages: { enabled: true }
to be set on every collection referenced in the Sync Rules. Replication will error if this is not configured. This option is ideal when permissions are restricted.read_only
mode, run this on each collection:
post_images
in the config.yaml
file.