literal_binds not honored for multi values insert

Issue #3880 resolved
Mike Bayer repo owner created an issue
from sqlalchemy import *

m = MetaData()
t = Table('t', m, Column('x', Integer), Column('y', Integer))

stmt = t.insert().values([{"x": 1, "y": 1}, {"x": 2, "y": 2}, {"x": 3, "y": 3}])

from sqlalchemy.dialects import postgresql
print stmt.compile(dialect=postgresql.dialect(), compile_kwargs=dict(literal_binds=True))

INSERT INTO t (x, y) VALUES (1, 1), (%(x_m1)s, %(y_m1)s), (%(x_m2)s, %(y_m2)s)

Comments (1)

  1. Mike Bayer reporter

    Pass **kw to bound params in multi values

    Fixed bug where literal_binds compiler flag was not honored by the :class:.Insert construct for the "multiple values" feature; the subsequent values are now rendered as literals.

    Change-Id: I81ac358fd59995885d482e7571620090210865d2 Fixes: #3880

    → <<cset 4fec72f178f0>>

  2. Log in to comment