v0.20.0
Added
-
A lone
%in asql=statement is refused at declaration time. The
statement is run with its parameters, and an empty parameter sequence is still
a sequence, so a%that is not a placeholder is read as the start of one:
the failure came frompsycopg/cursor.pyat build time, naming the driver and
nothing about the shape. A caller who passed no parameters at all had no model
that explained it, and the modulo operator is the reason anyone writes a bare
%in the first place.A valid statement can never contain one, so nothing legal is refused -- which
is the whole reason this can be a refusal rather than an escape.sql=takes
params=, so pyformat is its interface and%%stays the spelling for the
operator.SqlValueon the derived path escapes instead, and the two are not
inconsistent: there the caller supplies no parameters and has no reason to
know one exists. Both docstrings and the projections guide now say which is
which, at both call sites, because the asymmetry is exactly what a reader
finding one of them will next be confused by.