Skip to content

Commit 01fa153

Browse files
authored
feat(mysql): add the MySQL destination package (#40)
1 parent 4f9aebf commit 01fa153

43 files changed

Lines changed: 6947 additions & 3 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/ci.yml‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,46 @@ jobs:
108108
# packages rather than the sources the unit tests import.
109109
- name: End-to-end example
110110
run: pnpm --filter workos-sync-postgres-example start
111+
112+
mysql:
113+
name: MySQL Node ${{ matrix.node }}
114+
runs-on: ubuntu-latest
115+
strategy:
116+
fail-fast: false
117+
matrix:
118+
node: [22, 24]
119+
services:
120+
mysql:
121+
image: mysql:8.4
122+
env:
123+
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
124+
ports:
125+
- 127.0.0.1:3306:3306
126+
options: >-
127+
--health-cmd "mysqladmin ping -h 127.0.0.1"
128+
--health-interval 5s
129+
--health-timeout 5s
130+
--health-retries 20
131+
env:
132+
# There is no embedded MySQL, so the whole suite runs against the
133+
# service; without this variable the database-backed tests skip.
134+
TEST_MYSQL_URL: mysql://root@127.0.0.1:3306
135+
steps:
136+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
137+
with:
138+
persist-credentials: false
139+
140+
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
141+
142+
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
143+
with:
144+
node-version: ${{ matrix.node }}
145+
146+
- name: Install
147+
run: pnpm install --frozen-lockfile
148+
149+
- name: Test
150+
run: pnpm --filter @workos/sync-mysql test:database
151+
152+
- name: Build
153+
run: pnpm --filter "@workos/sync-mysql..." build

‎.github/workflows/docker.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
# One entry per destination package: packages/sync-<destination>.
2323
destination:
2424
- postgres
25+
- mysql
2526
runner: [ubuntu-latest, ubuntu-24.04-arm]
2627
steps:
2728
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

‎.release-please-manifest.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"packages/sync-engine": "0.1.0",
3-
"packages/sync-postgres": "0.1.0"
3+
"packages/sync-postgres": "0.1.0",
4+
"packages/sync-mysql": "0.0.0"
45
}

‎README.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ SELECT o.name AS organization, u.email, m.role_slug
2626
The `_live` views are generated next to the tables and hide deleted rows; the
2727
base tables keep them as tombstones for when you want to ask who left.
2828

29+
## Destinations
30+
31+
One engine, one package per database. Each ships a CLI with the same
32+
commands and a container image under the same name:
33+
34+
| Destination | Package | Mirror |
35+
| ----------- | ------------------------------------------------- | ---------------------------------------------------------------------- |
36+
| Postgres | [`@workos/sync-postgres`](packages/sync-postgres) | A `workos` schema of tables with generated columns and `_live` views |
37+
| MySQL | [`@workos/sync-mysql`](packages/sync-mysql) | A `workos` database of tables with generated columns and `_live` views |
38+
39+
The rest of this page shows Postgres; every command and option below has a
40+
MySQL counterpart, and each package's README is the reference for it.
41+
2942
## Try it in 30 seconds
3043

3144
No credentials, no Docker, no network. Runs the whole lifecycle against a

‎packages/sync-engine/README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ package and re-exports it, so it is the only thing to install:
1111
| Destination | Package |
1212
| ----------- | ------------------------------------------------------------------------------ |
1313
| Postgres | [`@workos/sync-postgres`](https://www.npmjs.com/package/@workos/sync-postgres) |
14+
| MySQL | [`@workos/sync-mysql`](https://www.npmjs.com/package/@workos/sync-mysql) |
1415

1516
Install this package directly only to write a new destination.
1617

‎packages/sync-mysql/LICENSE.txt‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 WorkOS
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)