PlanetScale
Mirror your WorkOS data into PlanetScale Postgres or Vitess.
PlanetScale hosts Postgres and Vitess, a MySQL-compatible database. The sync engine connects through each engine’s standard protocol using @workos/sync-postgres or @workos/sync-mysql.
The PlanetScale integration guide in the sync engine repository covers database creation, roles, connection strings, TLS, endpoint verification, and deployment.
Follow the Postgres guide with your PlanetScale connection string as DATABASE_URL. The sync needs a role that can create the mirror’s schema and objects; the default read/write role is not enough for initialization.
Keep sslmode=verify-full, but remove sslrootcert=system from PlanetScale’s connection string when using the Node.js driver. See the repository’s Postgres setup for the role, connection options, TLS behavior, and commands.
Use the MySQL destination, with two PlanetScale-specific considerations:
- The branch is the database. Set
WORKOS_SYNC_SCHEMAto the branch’s database name rather than letting the sync create a separateworkosdatabase. - Safe migrations control schema changes. On a protected production branch, apply the mirror’s schema through a PlanetScale deploy request rather than running DDL directly.
Follow the repository’s Vitess setup for credentials, the required TLS CA configuration, and the safe-migrations workflow. The @workos/sync-mysql README is the reference for commands and configuration.