Add PostgreSQL as a first-class WordPress test backend#428
Draft
adamziel wants to merge 309 commits into
Draft
Conversation
0565082 to
f3b5bd7
Compare
Preserve system-variable scope for simple SELECT references, validate strict temporal UPDATE and upsert expressions before storage, and refresh the affected PostgreSQL driver test expectations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Big picture
Adds PostgreSQL backend in addition to the SQLite backend.
How to try it locally
PostgreSQL is selected with
WP_TEST_DB_BACKEND=postgresql; the aliasespostgresandpgsqlwork too.That setup writes PostgreSQL-specific generated files under
wordpress/, including:wordpress/docker-compose.override.ymlwithDB_ENGINE=postgresql,DATABASE_ENGINE=postgresql, apostgresservice, and the inherited MySQL service reset;wordpress/wp-config.phpandwordpress/wp-tests-config.phpwith PostgreSQL constants;wordpress/src/wp-content/db.phpplus the copiedsqlite-database-integrationplugin target that loads the PostgreSQLwpdbadapter;pdo_pgsql.For a clean rebuild, use:
If a previous interrupted setup left
.wp-setup.lockbehind, remove it only after confirming nowp-setup.shorcomposer run wp-setupprocess is still running.What changed
wpdbbehavior.continue-on-errorjob.DATE_ADD(),DATE_SUB(),TIMESTAMPDIFF(),DATE_FORMAT(), and related temporal functions;ON DUPLICATE KEY UPDATE,VALUES(),LAST_INSERT_ID(id), andROW_COUNT()behavior;CREATE TABLE,ALTER TABLE,CREATE TABLE LIKE, and metadata preservation;information_schema,SHOW, SQL mode, and session-variable compatibility;Validation
The current PR checks are passing, including code style, package PHPUnit, WordPress PHPUnit, WordPress e2e, MySQL proxy tests, lexer benchmark, WASM extension build, and release metadata checks.
Local validation also included focused regression runs for the PostgreSQL failures found during parity work, plus the full package-level PostgreSQL suite:
packages/mysql-on-sqlitePostgreSQL suite:OK (897 tests, 7181 assertions)OK (6 tests, 133 assertions)composer check-cs -- --no-cache --report-summary:19 / 19 (100%)WordPress PHPUnit: SQLite 24,648 passed; PostgreSQL 24,628 passed
[####################] 100%Known limitations and review notes
wordpress/checkout files, node modules, Docker images, and config artifacts. Stale generated state can produce misleading local results; rerun the setup path before trusting local WordPress runtime output.Reviewer focus
The highest-value review areas are the backend translation boundaries, fail-closed behavior for unsupported MySQL syntax, WordPress config/setup generation, and the CI contract that keeps PostgreSQL failures visible.