PHPackages                             ibraheem-ghazi/dbdiff - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. ibraheem-ghazi/dbdiff

ActiveLibrary[Database &amp; ORM](/categories/database)

ibraheem-ghazi/dbdiff
=====================

php based script that helps developers to find the difference between two databases structure and compare it with auto generating queries

1.1(7y ago)224MITPHPPHP &gt;=5.6.0

Since Nov 21Pushed 7y agoCompare

[ Source](https://github.com/ibraheem-ghazi/dbdiff)[ Packagist](https://packagist.org/packages/ibraheem-ghazi/dbdiff)[ RSS](/packages/ibraheem-ghazi-dbdiff/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

DBDiff (Database Differenece Compare)
=====================================

[](#dbdiff-database-differenece-compare)

DBDiff is a php based script that helps developers to find the difference between two databases structure,catch new added columns, deleted columns, changed columns and which attributes are changed, and so on, with queries generate like (ALTER,CREATE ...etc)

Screenshots
===========

[](#screenshots)

[![dbdiff queries](https://raw.githubusercontent.com/ibraheem-ghazi/dbdiff/master/screenshots/dbdiff-queries.png)](https://raw.githubusercontent.com/ibraheem-ghazi/dbdiff/master/screenshots/dbdiff-queries.png)[![dbdiff results](https://raw.githubusercontent.com/ibraheem-ghazi/dbdiff/master/screenshots/dbdiff-results.png)](https://raw.githubusercontent.com/ibraheem-ghazi/dbdiff/master/screenshots/dbdiff-results.png)[![dbdiff constraints](https://raw.githubusercontent.com/ibraheem-ghazi/dbdiff/master/screenshots/dbdiff-constraints.PNG)](https://raw.githubusercontent.com/ibraheem-ghazi/dbdiff/master/screenshots/dbdiff-constraints.PNG)

Features
========

[](#features)

- show difference each table as block
- show only differences
- generate queries for separately for each column or table
- can merge queries and copy it all at once.
- show column attribute old value and new value.
- view actual source for old or new by adding source=1 or source=2
- *MYSQL Dependent* WITHOUT using and system command like `mysqldump`
- simple ui

Why DBDiff ?
============

[](#why-dbdiff-)

after long search for scripts to use all solution was executing `mysqldump` system command using `exec` or `shell_exec` in php and get the output as sql dump then compare the difference. which is not accurate and can have many wrong information based on text position , also not clear what excatly change is happened. that's why i built this library which is based on executing mysql `show` and `desc` tables and parsing information manually then print the analysed results alongside with it's queries.

### TODOs

[](#todos)

- Handle Create Tables
- Handle Alter Tables
- Handle Drop table Queries
- Handle constraints (PK,FK,index, ... etc)
- Handle events
- Handle functions
- Handle procedures
- Handle triggers
- Handle views

### Installation

[](#installation)

to install this library using composer:

```
composer require ibraheem-ghazi/dbdiff
```

> *NOTE:* Secure the script and don't allow public access to it.

### Development

[](#development)

Want to contribute? Great! i accept pull requests.

License
-------

[](#license)

MIT

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~20 days

Total

2

Last Release

2713d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/26fee2d484e23dfd586443a58f0540f4092e7871b79b93c66becb073e51ca9b5?d=identicon)[IbraheemAlnabriss](/maintainers/IbraheemAlnabriss)

---

Top Contributors

[![ibraheem-ghazi](https://avatars.githubusercontent.com/u/22643210?v=4)](https://github.com/ibraheem-ghazi "ibraheem-ghazi (11 commits)")

---

Tags

comparedatabasediffdifferencemysqlphpphpdatabasemysqlcomparedifference

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ibraheem-ghazi-dbdiff/health.svg)

```
[![Health](https://phpackages.com/badges/ibraheem-ghazi-dbdiff/health.svg)](https://phpackages.com/packages/ibraheem-ghazi-dbdiff)
```

###  Alternatives

[clouddueling/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k22.9k](/packages/clouddueling-mysqldump-php)[stefangabos/zebra_database

An advanced, compact and lightweight MySQL database wrapper library, built around PHP's MySQLi extension.

11812.0k](/packages/stefangabos-zebra-database)[popphp/pop-db

Pop Db Component for Pop PHP Framework

1814.6k11](/packages/popphp-pop-db)[riverside/php-orm

PHP ORM micro-library and query builder

111.2k](/packages/riverside-php-orm)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
