Database Setup
Configuring your database with PowerSync involves three tasks:
PowerSync reads the WAL in order to create sync tables in accordance with the specified sync rules. For more info on sync rules, see this section.
If you are managing PostgreSQL yourself, set
wal_level = logical
in your config file:

If you're using managed PostgreSQL, enable it in the relevant section of the admin console. Amazon RDS is shown below.

Create a PowerSync user on PostgreSQL:
-- SQL to create powersync user
CREATE ROLE powersync_role WITH REPLICATION LOGIN PASSWORD 'myhighlyrandompassword';
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO powersync_role;
-- Create publication to replicate tables. Specify a subset of tables if required.
-- NOTE: this must be named "powersync" at the moment
CREATE PUBLICATION powersync FOR ALL TABLES;
For read-only access, only the
SELECT
privilege is required — INSERT
, UPDATE
and DELETE
can be removed. To restrict read access to specific tables, explicitly list allowed tables for both the SELECT
privilege, and for the publication (as well as for any other publications that may exist).- 1.

- 2.Give your instance a name, such as "Azure Testing"
- 3.Under the "General" tab, you can change the default cloud region from US to EU if desired (more cloud regions are available, contact us if you need a different region).
- 4.Under the "Connections" tab, click on the + icon:
- 5.Fill in the connection details on the subsequent screen. If you want to query your database via the PowerSync dashboard, enable "Allow querying in the editor?". Also note that if you're using a self-signed SSL certificate for your database server, it's possible to upload a custom CA file in PEM format.
- 6.Click "Test Connection" and fix any errors:
- 7.Click "Save"
- 8.PowerSync deploys and configures an isolated cloud environment for you, which will take a few minutes to complete:
Last modified 1mo ago