[PR #141] [MERGED] Adding Postgres 14-18 & SQLite Support #273

Closed
opened 2026-03-07 20:42:37 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/DBDiff/DBDiff/pull/141
Author: @jasdeepkhalsa
Created: 3/3/2026
Status: Merged
Merged: 3/3/2026
Merged by: @jasdeepkhalsa

Base: masterHead: feature/sqlite-postgres-support


📝 Commits (10+)

  • e0c0bab feat: add PostgreSQL and SQLite support via DB adapter + SQL dialect pattern
  • 38f2a85 test: add PostgreSQL and SQLite end-to-end tests + Docker integration
  • 7d1b299 docs: update README + DOCKER.md for PostgreSQL/SQLite/Podman support; add Podman compat to start.sh/stop.sh
  • 6b66103 fix: ADD/DROP COLUMN regression + SQLite fixture crash + GHA Postgres/SQLite jobs
  • 181394f Expanding matrix of tests for Postgres and PHP versions for PG & SQLite
  • 1d327d3 refactor: extract AbstractAnsiDialect to eliminate SonarQube duplication
  • 5e41426 feat: commit SQLite and Postgres baseline files; fix Podman image names
  • 9063573 feat: add e2e baselines for Postgres 14, 15, 17, 18
  • 56270c3 fix: resolve all 23 SonarQube issues on PR #141
  • 3010b18 fix: reduce resolveParameterisedType cognitive complexity to 15

📊 Changes

139 files changed (+5166 additions, -897 deletions)

View changed files

📝 .env.example (+14 -0)
📝 .github/workflows/tests.yml (+85 -1)
📝 DOCKER.md (+97 -4)
📝 README.md (+63 -16)
📝 docker-compose.yml (+253 -8)
📝 docker/Dockerfile (+6 -4)
scripts/gen-postgres-baselines.sh (+81 -0)
📝 scripts/run-tests.sh (+51 -13)
src/DB/Adapters/AdapterFactory.php (+22 -0)
src/DB/Adapters/DBAdapterInterface.php (+61 -0)
src/DB/Adapters/MySQLAdapter.php (+90 -0)
src/DB/Adapters/PostgresAdapter.php (+240 -0)
src/DB/Adapters/SQLiteAdapter.php (+156 -0)
📝 src/DB/DBManager.php (+68 -40)
📝 src/DB/Data/LocalTableData.php (+279 -7)
📝 src/DB/DiffCalculator.php (+5 -0)
📝 src/DB/Schema/DBSchema.php (+19 -21)
📝 src/DB/Schema/TableSchema.php (+24 -50)
📝 src/Diff/AddTable.php (+8 -3)
📝 src/Diff/DropTable.php (+8 -3)

...and 80 more files

📄 Description

Summary

New database support

  • Added full PostgreSQL and SQLite diff support alongside MySQL.
  • Introduced a DBAdapterInterface with dedicated MySQLAdapter, PostgresAdapter, and SQLiteAdapter implementations.
  • Added a DialectRegistry + SQLDialectInterface with AbstractAnsiDialect, MySQLDialect, PostgresDialect, and SQLiteDialect — all SQL generation classes now delegate to the active dialect.

Data diffing

  • PostgreSQL: PHP-side row comparison (no cross-database SQL JOINs).
  • SQLite: ATTACH DATABASE approach for cross-file JOINs.

Infrastructure

  • docker-compose.yml extended with PostgreSQL 14–18 services.
  • start.sh / stop.sh updated with Podman compatibility.
  • GitHub Actions matrix expanded to cover Postgres and SQLite across multiple PHP versions.

Tests

  • New End2EndPostgresTest, End2EndSQLiteTest, comprehensive suites, and baseline fixture files for all supported PG versions.

Refactoring / quality

  • All SonarQube issues resolved.
  • AbstractComprehensiveTest extracted to eliminate duplication across MySQL, Postgres, and SQLite suites.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/DBDiff/DBDiff/pull/141 **Author:** [@jasdeepkhalsa](https://github.com/jasdeepkhalsa) **Created:** 3/3/2026 **Status:** ✅ Merged **Merged:** 3/3/2026 **Merged by:** [@jasdeepkhalsa](https://github.com/jasdeepkhalsa) **Base:** `master` ← **Head:** `feature/sqlite-postgres-support` --- ### 📝 Commits (10+) - [`e0c0bab`](https://github.com/DBDiff/DBDiff/commit/e0c0bab1155580def5b6f83a613c4749af01b9f0) feat: add PostgreSQL and SQLite support via DB adapter + SQL dialect pattern - [`38f2a85`](https://github.com/DBDiff/DBDiff/commit/38f2a85287d66bff22666775048f269f3e02cf10) test: add PostgreSQL and SQLite end-to-end tests + Docker integration - [`7d1b299`](https://github.com/DBDiff/DBDiff/commit/7d1b299707283c67f2b25ea6506dea7607fa34aa) docs: update README + DOCKER.md for PostgreSQL/SQLite/Podman support; add Podman compat to start.sh/stop.sh - [`6b66103`](https://github.com/DBDiff/DBDiff/commit/6b661035a047732995d1b703abdb829271981be4) fix: ADD/DROP COLUMN regression + SQLite fixture crash + GHA Postgres/SQLite jobs - [`181394f`](https://github.com/DBDiff/DBDiff/commit/181394f5fe3da0d4014c281dd61b05a4fe22f079) Expanding matrix of tests for Postgres and PHP versions for PG & SQLite - [`1d327d3`](https://github.com/DBDiff/DBDiff/commit/1d327d35ea6f29f13ba60c3ae95d9a8f70ad058a) refactor: extract AbstractAnsiDialect to eliminate SonarQube duplication - [`5e41426`](https://github.com/DBDiff/DBDiff/commit/5e41426e4fc27d9ccae640e75f43de085e0c1006) feat: commit SQLite and Postgres baseline files; fix Podman image names - [`9063573`](https://github.com/DBDiff/DBDiff/commit/9063573d3001a2b49358aeb6bcdced4a4df9de3d) feat: add e2e baselines for Postgres 14, 15, 17, 18 - [`56270c3`](https://github.com/DBDiff/DBDiff/commit/56270c3b76fb874b93bffbf47c42c8d1df1bc0d1) fix: resolve all 23 SonarQube issues on PR #141 - [`3010b18`](https://github.com/DBDiff/DBDiff/commit/3010b1831ca5c3ab8e8845b6e5b65ac15252d5ac) fix: reduce resolveParameterisedType cognitive complexity to 15 ### 📊 Changes **139 files changed** (+5166 additions, -897 deletions) <details> <summary>View changed files</summary> 📝 `.env.example` (+14 -0) 📝 `.github/workflows/tests.yml` (+85 -1) 📝 `DOCKER.md` (+97 -4) 📝 `README.md` (+63 -16) 📝 `docker-compose.yml` (+253 -8) 📝 `docker/Dockerfile` (+6 -4) ➕ `scripts/gen-postgres-baselines.sh` (+81 -0) 📝 `scripts/run-tests.sh` (+51 -13) ➕ `src/DB/Adapters/AdapterFactory.php` (+22 -0) ➕ `src/DB/Adapters/DBAdapterInterface.php` (+61 -0) ➕ `src/DB/Adapters/MySQLAdapter.php` (+90 -0) ➕ `src/DB/Adapters/PostgresAdapter.php` (+240 -0) ➕ `src/DB/Adapters/SQLiteAdapter.php` (+156 -0) 📝 `src/DB/DBManager.php` (+68 -40) 📝 `src/DB/Data/LocalTableData.php` (+279 -7) 📝 `src/DB/DiffCalculator.php` (+5 -0) 📝 `src/DB/Schema/DBSchema.php` (+19 -21) 📝 `src/DB/Schema/TableSchema.php` (+24 -50) 📝 `src/Diff/AddTable.php` (+8 -3) 📝 `src/Diff/DropTable.php` (+8 -3) _...and 80 more files_ </details> ### 📄 Description ## Summary ### New database support - Added full **PostgreSQL** and **SQLite** diff support alongside MySQL. - Introduced a `DBAdapterInterface` with dedicated `MySQLAdapter`, `PostgresAdapter`, and `SQLiteAdapter` implementations. - Added a `DialectRegistry` + `SQLDialectInterface` with `AbstractAnsiDialect`, `MySQLDialect`, `PostgresDialect`, and `SQLiteDialect` — all SQL generation classes now delegate to the active dialect. ### Data diffing - PostgreSQL: PHP-side row comparison (no cross-database SQL JOINs). - SQLite: `ATTACH DATABASE` approach for cross-file JOINs. ### Infrastructure - `docker-compose.yml` extended with PostgreSQL 14–18 services. - `start.sh` / `stop.sh` updated with Podman compatibility. - GitHub Actions matrix expanded to cover Postgres and SQLite across multiple PHP versions. ### Tests - New `End2EndPostgresTest`, `End2EndSQLiteTest`, comprehensive suites, and baseline fixture files for all supported PG versions. ### Refactoring / quality - All SonarQube issues resolved. - `AbstractComprehensiveTest` extracted to eliminate duplication across MySQL, Postgres, and SQLite suites. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-07 20:42:37 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/DBDiff#273
No description provided.