diff --git a/intro/setup-guide.mdx b/intro/setup-guide.mdx index 4ecd0a20..efbc7ed8 100644 --- a/intro/setup-guide.mdx +++ b/intro/setup-guide.mdx @@ -19,7 +19,7 @@ import DevTokenSelfHostedSteps from '/snippets/dev-token-self-hosted-steps.mdx'; ## 1. Configure Your Source Database -PowerSync needs to connect to your source database (Postgres, MongoDB, MySQL, SQL Server or Convex) to replicate data. Before setting up PowerSync, you need to configure your database with the appropriate permissions and replication settings. +PowerSync needs to connect to your source database (Postgres, MongoDB, Azure DocumentDB, MySQL, SQL Server or Convex) to replicate data. Before setting up PowerSync, you need to configure your database with the appropriate permissions and replication settings. Using the [PowerSync CLI](/tools/cli) and want an automatically integrated Postgres instance for local development? You can skip to [Step 2](#2-set-up-powersync-service-instance) and set one up with the **CLI (Self-Hosted)** tab. @@ -133,7 +133,13 @@ Using the [PowerSync CLI](/tools/cli) and want an automatically integrated Postg - + + Setup, permissions, and connection steps for Azure DocumentDB are the same as MongoDB, except for a Post Images setting. Follow the setup instructions for MongoDB, then see [Azure DocumentDB Source Database Setup](/configuration/source-db/setup#azure-documentdb) for further details. + + Azure DocumentDB support is currently an [Experimental release](/resources/feature-status). + + + For MySQL, you need to configure binary logging and create a user with replication privileges: ```sql @@ -161,6 +167,7 @@ Using the [PowerSync CLI](/tools/cli) and want an automatically integrated Postg PowerSync requires MySQL version 5.7 or greater. + MySQL support is currently in a [Beta release](/resources/feature-status). **Learn More** @@ -169,16 +176,20 @@ Using the [PowerSync CLI](/tools/cli) and want an automatically integrated Postg - + Refer to [these instructions](/configuration/source-db/setup#sql-server). **Self-hosting PowerSync?** See the [Self-Host-Demo App](https://github.com/powersync-ja/self-host-demo/tree/main/demos/nodejs-mssql) for a complete working example of connecting a SQL Server source database to PowerSync. + + SQL Server support is currently in a [Beta release](/resources/feature-status). - + Configuring Convex for PowerSync involves adding a `powersync_checkpoints` table and a `createCheckpoint` mutation to your Convex deployment, then generating a deploy key. See [Convex Source Database Setup](/configuration/source-db/setup#convex) for the full steps. For a complete working example, see the [PowerSync Convex To-Do List Demo](https://github.com/powersync-community/powersync-convex-todolist-demo). + + Convex support is currently an [Experimental release](/resources/feature-status). @@ -302,7 +313,7 @@ PowerSync is available as a cloud-hosted service (PowerSync Cloud) or can be sel # Source database connection (see the next step for more details) replication: connections: - - type: postgresql # or mongodb, mysql, mssql + - type: postgresql # or mongodb, mysql, mssql. for azure documentdb, use mongodb uri: postgresql://powersync_role:myhighlyrandompassword@powersync-postgres:5432/postgres sslmode: disable # Only for local/private networks @@ -352,13 +363,14 @@ The next step is to connect your PowerSync Service instance to your source datab In the [PowerSync Dashboard](https://dashboard.powersync.com/), select your project and instance, then go to **Database Connections**: 1. Click **Connect to Source Database** - 2. Select the appropriate database type tab (Postgres, MongoDB, MySQL, SQL Server or Convex) + 2. Select the appropriate database type tab (Postgres, MongoDB, MySQL, SQL Server or Convex). For Azure DocumentDB, select MongoDB. 3. Fill in your connection details: Use the username (e.g., `powersync_role`) and password you created in Step 1: Configure your Source Database. - **Postgres**: Host, Port (5432), Database name, Username, Password, SSL Mode - **MongoDB**: Connection URI (e.g., `mongodb+srv://user:pass@cluster.mongodb.net/database`) + - **Azure DocumentDB**: Connection URI (e.g., `mongodb+srv://user:pass@cluster.windows.net/database`) - **MySQL**: Host, Port (3306), Database name, Username, Password - **Convex**: Deployment URL and deploy key. See [Convex Source Database Setup](/configuration/source-db/setup#convex). - **SQL Server**: Name, Host, Port (1433), Database name, Username, Password @@ -399,6 +411,14 @@ The next step is to connect your PowerSync Service instance to your source datab post_images: auto_configure ``` + ```yaml Azure DocumentDB + replication: + connections: + - type: mongodb + uri: mongodb+srv://user:password@cluster.windows.net/database + post_images: off + ``` + ```yaml MySQL replication: connections: @@ -442,6 +462,7 @@ The next step is to connect your PowerSync Service instance to your source datab ``` You'll also need to complete the source database setup from Step 1 (replication user, publication) on your external database before this will work. + @@ -508,13 +529,13 @@ streams: - SELECT * FROM lists WHERE NOT archived ``` -```yaml MongoDB Example +```yaml MongoDB/Azure DocumentDB Example config: edition: 3 streams: shared_data: auto_subscribe: true - # MongoDB uses "_id" but PowerSync uses "id" on the client + # MongoDB and Azure DocumentDB use "_id" but PowerSync uses "id" on the client queries: - SELECT *, _id as id FROM lists - SELECT *, _id as id FROM todos WHERE archived = false