Skip to content

Bind coordinated MySQL query operations - #28

Merged
alexstandiford merged 1 commit into
mainfrom
codex/coordinated-query-strategy
Sep 28, 2026
Merged

alexstandiford merged 1 commit into
mainfrom
codex/coordinated-query-strategy

Conversation

@alexstandiford

@alexstandiford alexstandiford commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

What changed

This adds the MySQL query layer above the PDO coordinator from PR 22.

  • The coordinated query strategy delegates transaction ownership to the PDO backend and gives each callback one same-resource, operation-local query handle.
  • The operation query delegate formats queries, clauses, insert tables, and insert columns through the exact backend supplied for that attempt. It never starts, commits, or rolls back a transaction.
  • The coordinator retains the exact active operation handle only during the callback. The MySQL provider factory can create fresh query and clause builders only for that handle.
  • The PDO initializer binds the ordinary and coordinated backend contracts to one backend instance. It also binds the ordinary and coordinated query contracts to one coordinator instance, then binds the operation provider factory.
  • Insert identity lookup now uses the uncached schema helper, so schema cache events and shared cache writes do not escape an uncommitted operation.
  • PR 22 head e3f0146ced3238a36b0c1e3db53eb3b5b46392ab includes current main, which carries the already merged operation-bound formatting and predicate validation changes.

Review dependency

phpnomad/db is pinned to PR 42 head 4b0b7709e5945a4290b04c2e3562ef919923ed08. This is a temporary review dependency for CoordinatedQueryStrategy, OperationQueryStrategy, OperationDatabaseHandlerBridge, and OperationDatabaseProviderFactory.

PR 25 remains separate. The operation-local insert path formats its columns through the active backend because it cannot safely depend on a global formatter.

Proof

Against an isolated MySQL 8.4.11 server:

  • focused coordinator and full bridge contracts: 6 tests, 62 assertions
  • full package: 794 tests, 5,164 assertions
  • the only two full-suite skips are the existing MySQL 5.7 refusal contracts
  • required bridge integration: 3 tests, 44 assertions, no skips

The bridge tests cover fresh reads despite a stale shared-cache value, commit, rollback of multiple writes and read-after-write, one callback invocation, undeclared-table refusal, expired-handle refusal, builder independence, publication suppression during the transaction, publication after commit, and clause construction through the exact operation resource. A poison global formatter makes resource escape fail.

Other checks:

  • PHPStan level 5 on lib and tests
  • PHP CS Fixer dry run on every changed PHP file
  • repository spellcheck action image 0.27.0
  • Composer validation, with the expected warning for the temporary commit pin
  • PHP 8.0 syntax checks on every changed PHP file

No merge, release, tag, or deployment is included.

@alexstandiford
alexstandiford changed the base branch from codex/pdo-coordinated-operations to main September 21, 2026 01:31
@alexstandiford
alexstandiford changed the base branch from main to codex/pdo-coordinated-operations September 21, 2026 01:31
@alexstandiford
alexstandiford changed the base branch from codex/pdo-coordinated-operations to main September 28, 2026 18:00
@alexstandiford
alexstandiford marked this pull request as ready for review September 28, 2026 18:00
@alexstandiford
alexstandiford merged commit 8391842 into main Sep 28, 2026
8 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T18:02:00.208675Z 23d08b9 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant