Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,41 @@ jobs:
- name: End-to-end example
run: pnpm --filter workos-sync-postgres-example start

mongodb:
name: MongoDB Node ${{ matrix.node }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [22, 24]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0

- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: ${{ matrix.node }}

# The suite runs on an embedded mongod (mongodb-memory-server), which
# downloads the binary on first use; the cache keeps that off the
# critical path. The version is pinned in the package's package.json.
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/.cache/mongodb-binaries
key: mongodb-binaries-${{ runner.os }}-${{ hashFiles('packages/sync-mongodb/package.json') }}

- name: Install
run: pnpm install --frozen-lockfile

- name: Test
run: pnpm --filter @workos/sync-mongodb test

- name: Build
run: pnpm --filter "@workos/sync-mongodb..." build

mysql:
name: MySQL Node ${{ matrix.node }}
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
# One entry per destination package: packages/sync-<destination>.
destination:
- postgres
- mongodb
- mysql
runner: [ubuntu-latest, ubuntu-24.04-arm]
steps:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
sync-postgres--tag_name: ${{ steps.release.outputs['packages/sync-postgres--tag_name'] }}
sync-mysql--release_created: ${{ steps.release.outputs['packages/sync-mysql--release_created'] }}
sync-mysql--tag_name: ${{ steps.release.outputs['packages/sync-mysql--tag_name'] }}
sync-mongodb--release_created: ${{ steps.release.outputs['packages/sync-mongodb--release_created'] }}
sync-mongodb--tag_name: ${{ steps.release.outputs['packages/sync-mongodb--tag_name'] }}
steps:
# Release PRs and tags come from the SDK Automation Bot, as in workos-node.
# Events raised with GITHUB_TOKEN start no workflow runs, so a release PR
Expand Down Expand Up @@ -94,3 +96,15 @@ jobs:
tag_name: ${{ needs.release-please.outputs.sync-mysql--tag_name }}
secrets:
PUBLIC_SOCKET_FIREWALL_TOKEN: ${{ secrets.PUBLIC_SOCKET_FIREWALL_TOKEN }}

publish-sync-mongodb:
needs: [release-please, publish-sync-engine]
if: >-
${{ !cancelled()
&& needs.publish-sync-engine.result != 'failure'
&& needs.release-please.outputs.sync-mongodb--release_created == 'true' }}
uses: ./.github/workflows/release.yml
with:
tag_name: ${{ needs.release-please.outputs.sync-mongodb--tag_name }}
secrets:
PUBLIC_SOCKET_FIREWALL_TOKEN: ${{ secrets.PUBLIC_SOCKET_FIREWALL_TOKEN }}
1 change: 1 addition & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"packages/sync-engine": "0.1.0",
"packages/sync-postgres": "0.1.0",
"packages/sync-mongodb": "0.0.0",
"packages/sync-mysql": "0.0.0"
}
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ base tables keep them as tombstones for when you want to ask who left.
One engine, one package per database. Each ships a CLI with the same
commands and a container image under the same name:

| Destination | Package | Mirror |
| ----------- | ------------------------------------------------- | ---------------------------------------------------------------------- |
| Postgres | [`@workos/sync-postgres`](packages/sync-postgres) | A `workos` schema of tables with generated columns and `_live` views |
| MySQL | [`@workos/sync-mysql`](packages/sync-mysql) | A `workos` database of tables with generated columns and `_live` views |
| Destination | Package | Mirror |
| ----------- | ------------------------------------------------- | ----------------------------------------------------------------------- |
| Postgres | [`@workos/sync-postgres`](packages/sync-postgres) | A `workos` schema of tables with generated columns and `_live` views |
| MongoDB | [`@workos/sync-mongodb`](packages/sync-mongodb) | `workos_*` collections in your database, with indexes and `_live` views |
| MySQL | [`@workos/sync-mysql`](packages/sync-mysql) | A `workos` database of tables with generated columns and `_live` views |

The rest of this page shows Postgres; every command and option below has a
MySQL counterpart, and each package's README is the reference for it.
MongoDB and a MySQL counterpart, and each package's README is the reference
for it.

## Try it in 30 seconds

Expand Down
1 change: 1 addition & 0 deletions packages/sync-engine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ package and re-exports it, so it is the only thing to install:
| Destination | Package |
| ----------- | ------------------------------------------------------------------------------ |
| Postgres | [`@workos/sync-postgres`](https://www.npmjs.com/package/@workos/sync-postgres) |
| MongoDB | [`@workos/sync-mongodb`](https://www.npmjs.com/package/@workos/sync-mongodb) |
| MySQL | [`@workos/sync-mysql`](https://www.npmjs.com/package/@workos/sync-mysql) |

Install this package directly only to write a new destination.
Expand Down
21 changes: 21 additions & 0 deletions packages/sync-mongodb/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 WorkOS

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Loading