Expose WordPress query sources and pinned builders - #43
Draft
alexstandiford wants to merge 1 commit into
Draft
alexstandiford wants to merge 1 commit into
alexstandiford wants to merge 1 commit into
Conversation
alexstandiford
force-pushed
the
codex/wordpress-query-boundary
branch
from
September 20, 2026 23:10
e8df634 to
496e357
Compare
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.
Scope
This PR stacks on PR 41. It adds the WordPress query-boundary prerequisite for coordinated database work.
QueryBuildernow implementsHasQueryTablesand reports the exact root table followed by every join table in query order. Full resets, clause resets, successful builds, root replacement, and builder reuse keep the metadata aligned with the SQL. The existing dynamic join state is now a declared property and resets with the rest of the query.QueryBuilderandClauseBuilderaccept an optionalwpdbobject. An explicit object owns preparation for that builder. Zero-argument construction still reads the WordPress global, including subclasses whose constructors do not call the parent constructor.Transaction ownership and coordinated execution remain in later slices.
Review dependency
The Composer constraint temporarily aliases
phpnomad/dbdev-release/2.2as2.2.x-dev. The lock points at17fb84703d260a66de874704ae37cf924b9d8c2b, which containsHasQueryTables. The review repository uses public HTTPS, so CI can install the branch without SSH keys. Replace the alias with a released constraint after the database release exists.Verification
Unit suite:
Result: 78 tests, 139 assertions.
Required real database suite:
Result: 60 tests, 116 assertions, with no failures, errors, or skips.
The integration proof uses official WordPress 6.8.3 at
ba9e7f97f08a7fbb88fbfa35641bcc230500b37aand MySQL 8.0.45. It replaces global$wpdbwith a throwing sentinel while both builders prepare through the injected realwpdb. The resulting joined query runs against MySQL. The same case proves exact root and join object identity, join removal, successful-build reset, and reuse without stale join SQL.Composer validation passes. Its existing package-version warning remains. GitHub CI installs the temporary dependency over public HTTPS and passes.
Architecture records