class Compiled: (source)
Known subclasses: sqlalchemy.sql.compiler.DDLCompiler
, sqlalchemy.sql.compiler.SQLCompiler
Represent a compiled SQL or DDL expression. The ``__str__`` method of the ``Compiled`` object should produce the actual text of the statement. ``Compiled`` objects are specific to their underlying database dialect, and also may or may not be specific to the columns referenced within a particular set of bind parameters. In no case should the ``Compiled`` object be dependent on the actual values of those bind parameters, even though it may reference those values as defaults.
Method | __init__ |
Construct a new :class:`.Compiled` object. |
Method | __init |
Undocumented |
Method | __str__ |
Return the string text of the generated SQL or DDL. |
Method | construct |
Return the bind params for this compiled object. |
Method | process |
Undocumented |
Method | visit |
Undocumented |
Class Variable | cache |
The :class:`.CacheKey` that was generated ahead of creating this :class:`.Compiled` object. |
Class Variable | compile |
Optional :class:`.CompileState` object that maintains additional state used by the compiler. |
Class Variable | dml |
Optional :class:`.CompileState` assigned at the same point that .isinsert, .isupdate, or .isdelete is assigned. |
Class Variable | is |
Undocumented |
Class Variable | is |
Undocumented |
Instance Variable | can |
Undocumented |
Instance Variable | dialect |
Undocumented |
Instance Variable | execution |
Undocumented |
Instance Variable | preparer |
Undocumented |
Instance Variable | schema |
Execution options propagated from the statement. In some cases, sub-elements of the statement can modify these. |
Instance Variable | state |
description of the compiler's state |
Instance Variable | statement |
The statement to compile. |
Instance Variable | string |
The string representation of the ``statement`` |
Property | params |
Return the bind params for this compiled object. |
Property | sql |
Return a Compiled that is capable of processing SQL expressions. |
Class Method | _init |
Undocumented |
Method | _execute |
Undocumented |
Class Variable | _cached |
Undocumented |
Class Variable | _result |
Undocumented |
Instance Variable | _annotations |
Undocumented |
Instance Variable | _gen |
Generation time of this :class:`.Compiled`, used for reporting cache stats. |
Dialect
, statement: Optional[ ClauseElement]
, schema_translate_map: Optional[ SchemaTranslateMapType]
= None, render_schema_translate: bool
= False, compile_kwargs: Mapping[ str, Any]
= util.immutabledict()):
(source)
¶
Construct a new :class:`.Compiled` object. :param dialect: :class:`.Dialect` to compile against. :param statement: :class:`_expression.ClauseElement` to be compiled. :param schema_translate_map: dictionary of schema names to be translated when forming the resultant SQL .. versionadded:: 1.1 .. seealso:: :ref:`schema_translating` :param compile_kwargs: additional kwargs that will be passed to the initial call to :meth:`.Compiled.process`.
Optional[ _CoreSingleExecuteParams]
= None, extracted_parameters: Optional[ Sequence[ BindParameter[ Any]]]
= None, escape_names: bool
= True) -> Optional[ _MutableCoreSingleExecuteParams]
:
(source)
¶
Return the bind params for this compiled object. :param params: a dict of string/object pairs whose values will override bind values compiled in to the statement.
sqlalchemy.sql.compiler.SQLCompiler
The :class:`.CacheKey` that was generated ahead of creating this :class:`.Compiled` object. This is used for routines that need access to the original :class:`.CacheKey` instance generated when the :class:`.Compiled` instance was first cached, typically in order to reconcile the original list of :class:`.BindParameter` objects with a per-statement list that's generated on each call.
sqlalchemy.sql.compiler.SQLCompiler
Optional :class:`.CompileState` object that maintains additional state used by the compiler. Major executable objects such as :class:`_expression.Insert`, :class:`_expression.Update`, :class:`_expression.Delete`, :class:`_expression.Select` will generate this state when compiled in order to calculate additional information about the object. For the top level object that is to be executed, the state can be stored here where it can also have applicability towards result set processing. .. versionadded:: 1.4
sqlalchemy.sql.compiler.SQLCompiler
Optional :class:`.CompileState` assigned at the same point that .isinsert, .isupdate, or .isdelete is assigned. This will normally be the same object as .compile_state, with the exception of cases like the :class:`.ORMFromStatementCompileState` object. .. versionadded:: 1.4.40
Execution options propagated from the statement. In some cases, sub-elements of the statement can modify these.
Return a Compiled that is capable of processing SQL expressions. If this compiler is one, it would likely just return 'self'.