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
changeStream
collection: ""
db: ""
find
_powersync_checkpoints
collection: createCollection
, dropCollection
, find
, changeStream
, insert
, update
, and remove
changeStreamPreAndPostImages
on
replicated collections, additionally add the collMod
permission on all replicated collections.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.gtid_mode
: ON
enforce_gtid_consistency
: ON
binlog_format
: ROW