Repository navigation
7.0.0-beta2
Pre-releaseChanges since 7.0.0-beta1. Read together with the 7.0.0-beta1 notes for
everything since 3.x.
Breaking
-
[BRK] A value given for a
?placeholder in a condition is bound under a
generated name, as a list for one already was:where('id = ?', [5])
rendersid = :__1__, and getBindValues() returns['__1__' => 5]rather
than[0 => 5]. Passing getBindValues() to execute() is unaffected. Code
that reached the value by number afterwards --getBindValues()[0], or
bindValue(0, ...)to replace it -- has to give it a name instead. In
return, a statement never mixes?with named placeholders, which plain
PDO rejects on MySQL and PostgreSQL (and which pdo_sqlite ran with the?
unbound), and?placeholders from separate calls no longer both claim the
number 0, which 3.x rendered against a single value. A?no value
was given for -- in a condition given no values, or only named ones -- is
kept for binding by hand, as in 3.x, and values given for?have to
match the?one for one or InvalidArgumentException is thrown. Values
for?passed with a closure condition fill the?its conditions leave
without a value, in reading order and under names taken before the
closure runs:where(fn ($q) => $q->where('a = ?')->where('b = ?', [6]), [5])rendersa = :__1__ AND b = :__2__, where it bound 5 by number. A doubled
??, PDO's escape for a literal?, is not read as a placeholder, and
neither is a?inside a comment or a string literal, read as the
dialect reads them -- on MySQL#begins a comment and--does only
before whitespace, soa--?there is subtraction and a placeholder, and
on PostgreSQLE'...'escape strings and$$...$$dollar-quoted strings
are literals too. resetWhere(), resetHaving(), resetTables(),
resetUnions() and resetWith() drop the generated values their clause
bound -- for?values and lists alike -- unless a rendered
UNION branch still spells them, since nobody can rebind a generated name
and a value left behind is a parameter PDO rejects at execute(). Values
bound under a name you wrote are kept, as before.A subclass written against 7.0.0-beta1 that overrode the protected
Select::$text_patternproperty must overridegetTextPattern()
instead: the reading moved up to AbstractQuery so that conditions are
scanned with it, and the property no longer exists, so an override of it
would be ignored without a word.This replaces two behaviours 7.0.0-beta1 introduced:
?placeholders
bound by separate where() calls no longer throw, since each is bound under
a name of its own, and the InvalidArgumentException for a list or
sub-select given to a?the condition does not have is now thrown for
any count of values that does not match the?placeholders.
Fixed
- [FIX] On PostgreSQL, the quoter leaves a dollar-quoted string,
$$...$$or
$tag$...$tag$, as written. A dotted name inside one was quoted as a
table.column reference, sowhere('a = $$t.c$$')comparedawith the
string"t"."c", quotes included. A new Pgsql\Quoter does this; the
other dialects, which have no dollar quoting, are unchanged. Fixes #274.