text += " " + extra_from_text
if update_stmt._whereclause is not None:
- t = self.process(update_stmt._whereclause)
+ t = self.process(update_stmt._whereclause, **kw)
if t:
text += " WHERE " + t
def _create_bind_param(
compiler, col, value, process=True,
- required=False, name=None):
+ required=False, name=None, **kw):
if name is None:
name = col.key
bindparam = elements.BindParameter(
name, value, type_=col.type, required=required)
bindparam._is_crud = True
if process:
- bindparam = bindparam._compiler_dispatch(compiler)
+ bindparam = bindparam._compiler_dispatch(compiler, **kw)
return bindparam
compiler, c, value, required=value is REQUIRED,
name=_col_bind_name(c)
if not stmt._has_multi_parameters
- else "%s_0" % _col_bind_name(c)
+ else "%s_0" % _col_bind_name(c),
+ **kw
)
else:
if isinstance(value, elements.BindParameter) and \
literal_binds=True
)
+ def test_insert_literal_binds(self):
+ stmt = table1.insert().values(myid=3, name='jack')
+
+ self.assert_compile(
+ stmt,
+ "INSERT INTO mytable (myid, name) VALUES (3, 'jack')",
+ literal_binds=True)
+
+ def test_update_literal_binds(self):
+ stmt = table1.update().values(name='jack').where(table1.c.name == 'jill')
+
+ self.assert_compile(
+ stmt,
+ "UPDATE mytable SET name='jack' WHERE mytable.name = 'jill'",
+ literal_binds=True)
+
def test_select_precol_compile_ordering(self):
s1 = select([column('x')]).select_from(text('a')).limit(5).as_scalar()
s2 = select([s1]).limit(10)