Skip to content

refactor: centralize Query Builder join compilation#10237

Open
memleakd wants to merge 1 commit into
codeigniter4:4.8from
memleakd:refactor/join-condition-compiler
Open

refactor: centralize Query Builder join compilation#10237
memleakd wants to merge 1 commit into
codeigniter4:4.8from
memleakd:refactor/join-condition-compiler

Conversation

@memleakd
Copy link
Copy Markdown
Contributor

Description

This PR refactors Query Builder JOIN compilation so the shared condition handling lives in BaseBuilder instead of being duplicated by the SQLSRV builder.

SQLSRV still needs custom table-name qualification, so it now overrides only that small part. JOIN type handling, ON / USING condition compilation, and RawSql handling all go through the shared path.

This keeps the public API unchanged and preserves existing JOIN string behavior, while reducing driver-specific duplication. It also makes SQLSRV follow the same documented RawSql join-condition behavior as the base builder.

Tests cover SQLSRV multi-condition joins and RawSql joins.

No user guide or changelog entry is included because this does not add a new public API.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

- Move shared JOIN type and condition compilation into BaseBuilder
- Let SQLSRV customize only JOIN table-name compilation
- Add SQLSRV regression coverage for multi-condition and RawSql joins

Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com>
@github-actions github-actions Bot added the 4.8 PRs that target the `4.8` branch. label May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.8 PRs that target the `4.8` branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant