Google Cloud SQL
Instructions for configuring PowerSync for an Google Cloud SQL Postgres database.
Enable Logical Replication
In Google Cloud SQL Postgres, enabling the logical replication is done using flags:
Create a PowerSync Database User
Create a PowerSync user on Postgres:
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).
Create "powersync" Publication
Connect PowerSync to Your Database
In the PowerSync dashboard project tree, click on "Create new instance":
Give your instance a name, such as "GCP Testing".
Under the "General" tab, you can change the default cloud region from US to EU or JP if desired (more cloud regions are available, contact us if you need a different region).
Under the "DB Connections" tab, click on the + icon.
Now we get the connection details from Google Cloud SQL:
The server certificate can be downloaded from Google Cloud SQL.
If SSL is enforced, a client certificate and key must also be created on Google Cloud SQL, and configured on the PowerSync instance.
The Username and Password is the
powersync_role
created above.
Click "Test Connection" and fix any errors.
Click "Save".
PowerSync deploys and configures an isolated cloud environment for you, which will take a few minutes to complete.
Last updated