Skip to content

Conversation

@Rentacookie
Copy link
Contributor

@Rentacookie Rentacookie commented Nov 26, 2025

Introduce SQL Server / Azure SQL Database as a replication datasource

This change set enables PowerSync to listen for changes on MSSQL Databases that have Change Data Capture (CDC) enabled.

This is achieved by polling the CDC tables for updates on a regular interval and writing the changes to the bucket storage. For more details on how CDC works please see documentation:
CDC for SQL Server
CDC for Azure SQL Database

Requirements:

  1. CDC enabled MSSQL database
  2. _powersync_checkpoints table to allow PowerSync to generate regular updates. Table should be CDC enabled.
  3. CDC enabled on all the tables PowerSync needs to replicate.
  4. Database user with the following:
    • Read / Write permissions on the PowerSync checkpoints table.
    • Read permissions on the replicated tables
    • cdc_reader role which grants access to CDC tables and functions
    • VIEW SERVER PERFORMANCE STATE (SQL Server only)
    • VIEW DATABASE PERFORMANCE STATE (SQL Server and Azure SQL)

See init.sql for examples.

Self Hosted Demo available here:

More module templating
- MSSQL Connection manager
- Various utils for db querying
- Added schema utils
More module template files added
Added type mapping tests
@changeset-bot
Copy link

changeset-bot bot commented Nov 26, 2025

🦋 Changeset detected

Latest commit: b9dd9a0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
Name Type
@powersync/service-core Minor
@powersync/service-module-mssql Minor
@powersync/service-module-postgres-storage Patch
@powersync/service-module-mongodb-storage Patch
@powersync/service-module-postgres Patch
@powersync/service-errors Patch
@powersync/service-module-mysql Patch
@powersync/service-image Minor
@powersync/service-core-tests Patch
@powersync/service-module-core Patch
@powersync/service-module-mongodb Patch
test-client Patch
@powersync/service-schema Minor
@powersync/lib-services-framework Patch
@powersync/service-rsocket-router Patch
@powersync/lib-service-mongodb Patch
@powersync/lib-service-postgres Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Rentacookie Rentacookie changed the title [MSSQL] Support replication from SQL Server / Azure SQL Database [MSSQL] Alpha: Support replication from SQL Server / Azure SQL Database Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants