Skip to content

[codex] Use plain IN for single WordPress identity fields#29

Closed
alexstandiford wants to merge 1 commit into
mainfrom
codex/wordpress-single-identity-in
Closed

[codex] Use plain IN for single WordPress identity fields#29
alexstandiford wants to merge 1 commit into
mainfrom
codex/wordpress-single-identity-in

Conversation

@alexstandiford
Copy link
Copy Markdown
Contributor

Summary

  • Generate plain single-column IN clauses for single identity-field lookups in the WordPress clause builder.
  • Preserve row-constructor IN SQL for true compound identity fields.
  • Add unit coverage for single identity, multiple single-field identities, and compound identities.

Why

WordPress fetches records such as posts with a direct primary-key predicate (WHERE ID = %d LIMIT 1). PHPNomad's WordPress integration was generating row-constructor SQL even for a single identity field, e.g. (alias.id) IN ((%s)). This keeps the PHPNomad API unchanged while making the WordPress integration emit the simpler primary-key lookup shape WordPress itself uses for single-column identities.

Validation

  • vendor/bin/phpunit --filter ClauseBuilderTest --testdox
  • vendor/bin/phpunit --testdox

@alexstandiford
Copy link
Copy Markdown
Contributor Author

Closing this because it only makes the single-field IN query shape more WordPress-like. It is not proven to fix the intermittent create/readback failure and should not be represented as the root-cause fix.

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