Merql
Pure PHP three-way database merge with column-level conflict resolution. Git-style merge semantics applied to MySQL and SQLite tables.
composer require merql/merqlThree-Way Merge
Base, ours, theirs. Same algorithm git uses, applied to relational data. Detects inserts, updates, and deletes across two branches.
Column-Level Resolution
When both sides change the same row, merql compares column by column. Only conflicts when the same column is changed to different values.
Cell-Level Merge
TEXT columns merge line-by-line using Myers diff. JSON columns merge key-by-key. Resolves cases that column-level merge would flag as conflicts.
Multi-Database
Pluggable connection adapters and dialect drivers, with MySQL and SQLite built in.
Conflict Detection
Update vs update, update vs delete, insert vs insert. Every conflict type identified with table, row, and column precision.
SQL Generation
Parameterized INSERT, UPDATE, DELETE statements with FK-aware ordering. Dry-run preview or apply in a transaction.
CLI
Snapshot, diff, and merge from the command line. Supports MySQL and SQLite via environment variables.
Oracle-Tested
32 regression scenarios across 6 categories, unit and integration tests, PHPStan level 10.
Explore the complete Merql guide, from installation and first use through advanced workflows and API details.