MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / render_literal_execute

Method render_literal_execute

lib/sqlalchemy/sql/elements.py:2189–2212  ·  view source on GitHub ↗

Produce a copy of this bound parameter that will enable the :paramref:`_sql.BindParameter.literal_execute` flag. The :paramref:`_sql.BindParameter.literal_execute` flag will have the effect of the parameter rendered in the compiled SQL string using ``[POSTCOMPILE]``

(self)

Source from the content-addressed store, hash-verified

2187 return self.value
2188
2189 def render_literal_execute(self) -> Self:
2190 """Produce a copy of this bound parameter that will enable the
2191 :paramref:`_sql.BindParameter.literal_execute` flag.
2192
2193 The :paramref:`_sql.BindParameter.literal_execute` flag will
2194 have the effect of the parameter rendered in the compiled SQL
2195 string using ``[POSTCOMPILE]`` form, which is a special form that
2196 is converted to be a rendering of the literal value of the parameter
2197 at SQL execution time. The rationale is to support caching
2198 of SQL statement strings that can embed per-statement literal values,
2199 such as LIMIT and OFFSET parameters, in the final SQL string that
2200 is passed to the DBAPI. Dialects in particular may want to use
2201 this method within custom compilation schemes.
2202
2203 .. versionadded:: 1.4.5
2204
2205 .. seealso::
2206
2207 :ref:`engine_thirdparty_caching`
2208
2209 """
2210 c: Self = ClauseElement._clone(self)
2211 c.literal_execute = True
2212 return c
2213
2214 def _negate_in_binary(self, negated_op, original_op):
2215 if self.expand_op is original_op:

Calls 1

_cloneMethod · 0.45