MSR Features & Adapter Support
MSR provides a core set of features for managing migrations. Different adapters implement these features to varying degrees. The table below shows which features are available in each adapter.
| Feature | MSR Firebase | MSR PostgreSQL |
|---|---|---|
Multi-Format Migrations Use TypeScript, JavaScript, or SQL for your migrations, often in the same project. | β
Supported TS and JS supported. SQL is not applicable. | π In Progress |
Up/Down Methods Define both forward and reverse logic for each migration, enabling safe rollbacks. | β
Supported | π In Progress |
Timestamp & Sequential Migrations Organize migrations with timestamps or simple numeric sequences for clear ordering. | β
Supported | π In Progress |
State Tracking Automatically track which migrations have run in your database to prevent re-runs. | β
Supported Uses a dedicated node in Firebase RTDB. | π In Progress Will use a dedicated schema table. |
Dry Run Mode Simulate a migration run without making any actual changes to your database. | β
Supported Supported via Firebase RTDB transactions. | π In Progress Will be supported via SQL transactions. |
Database Backups Automatically back up your data before a migration runs for an extra layer of safety. | β
Supported | β Not Supported |
Rollback Strategies Choose how to roll back: use the "down" method, restore from backup, or both. | β
Supported | β οΈ Partial Down method will be supported. Backup-based rollback is TBD. |
Transaction Management Control how migrations are wrapped in transactions for atomic operations. | β οΈ Partial Supports transactions on a single data node per migration. | π In Progress Full transaction control per migration or per batch. |
Checksum Validation Verify that executed migration files haven't been altered to ensure consistency. | β
Supported | π In Progress |
Custom Validators Create your own rules to check migrations for correctness before they run. | β
Supported | π In Progress |
Lifecycle Hooks Run custom code at different stages of the migration process (e.g., beforeAll, afterEach). | β
Supported | π In Progress |
Extensible Handlers Build your own adapter to add MSR support for any database or data store. | β
Supported | π In Progress |
CLI and Programmatic API Use MSR via its intuitive command-line interface or as a library in your Node.js app. | β
Supported | π In Progress |
Migration Locking Prevent multiple instances from running migrations at the same time in distributed environments. | β
Supported | π In Progress |
.env & Environment Variable Support Configure MSR easily using .env files or environment variables instead of config files. | β
Supported | π In Progress |
All features come from the MSR core. Adapter support may vary.