Releases: kasapdev/php-query-builder
Releases · kasapdev/php-query-builder
Release list
v1.3.0
Added
- Subquery support for
where()/andWhere()/orWhere(): pass a nestedQueryBuilder
instance as a condition value and it compiles to a parenthesized(SELECT ...)subquery, with
the subquery's own bindings merged into the parent's bindings array in the exact left-to-right
order they appear in the rendered SQL.- Primary supported pattern:
WHERE ... IN (subquery), e.g.
where('id', 'IN', QueryBuilder::table('orders')->select(['user_id'])->where('total', '>', 100))
compiles to`id` IN (SELECT `user_id` FROM `orders` WHERE `total` > ?)with the subquery's
bindings correctly appended after any preceding outer bindings. - A subquery also works as a plain scalar comparison value (
where('id', '=', $subquery))
via the same detection path. - Extends the library's core "never interpolate a value into raw SQL" guarantee recursively to
nested queries, with new regression tests (including a malicious-value-inside-a-subquery
case and real SQLite execution of a subquery-bearing query) intests/run.php.
- Primary supported pattern:
See CHANGELOG.md and the new "Subqueries" section in README.md for details and examples.
v1.1.0
Adds edge-case regression tests: raw SQL expression passthrough in select(), dotted wildcard quoting (table.*), variadic groupBy() with multiple columns, orderBy() rejecting invalid directions, insert()/update() rejecting empty data, and IN with a scalar value. No behavioral changes; all tests pass.