Summary
Add a MySQL / MariaDB backend to zamsync project so events can be projected to mysql:// targets using INSERT IGNORE INTO.
Context and motivation
Several hospital information systems in low-resource settings (OpenMRS, DHIS2) use MySQL or MariaDB as their primary database. A native mysql:// projection target avoids an extra ETL hop.
Exact task
Follow the same pattern as the planned PostgreSQL target (see #related):
- Add
sqlx with mysql feature to Cargo.toml (if not already present from the PG issue)
- Create
src/cmd/project_mysql.rs with INSERT IGNORE INTO zamsync_events (...) VALUES (...)
- Table DDL mirrors the SQLite schema with MySQL types (
BIGINT UNSIGNED, LONGBLOB for payload)
- Dispatch in
src/cmd/project.rs: if --target starts with mysql://, call project_mysql::run()
- Integration test gated on
TEST_MYSQL_URL env var; skip if unset
Acceptance criteria
zamsync project <dir> --target mysql://root@localhost/zamsync works end-to-end
- Idempotent: second run inserts 0 rows
- Test skips gracefully when
TEST_MYSQL_URL is unset
Estimated effort
~2-4 h -- medium (new flag or filter, integration test)
Summary
Add a MySQL / MariaDB backend to
zamsync projectso events can be projected tomysql://targets usingINSERT IGNORE INTO.Context and motivation
Several hospital information systems in low-resource settings (OpenMRS, DHIS2) use MySQL or MariaDB as their primary database. A native
mysql://projection target avoids an extra ETL hop.Exact task
Follow the same pattern as the planned PostgreSQL target (see #related):
sqlxwithmysqlfeature toCargo.toml(if not already present from the PG issue)src/cmd/project_mysql.rswithINSERT IGNORE INTO zamsync_events (...) VALUES (...)BIGINT UNSIGNED,LONGBLOBfor payload)src/cmd/project.rs: if--targetstarts withmysql://, callproject_mysql::run()TEST_MYSQL_URLenv var; skip if unsetAcceptance criteria
zamsync project <dir> --target mysql://root@localhost/zamsyncworks end-to-endTEST_MYSQL_URLis unsetEstimated effort
~2-4 h -- medium (new flag or filter, integration test)