class documentation

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_subclass__ Undocumented
Method __str__ Return the string text of the generated SQL or DDL.
Method construct_params Return the bind params for this compiled object.
Method process Undocumented
Method visit_unsupported_compilation Undocumented
Class Variable cache_key The :class:`.CacheKey` that was generated ahead of creating this :class:`.Compiled` object.
Class Variable compile_state Optional :class:`.CompileState` object that maintains additional state used by the compiler.
Class Variable dml_compile_state Optional :class:`.CompileState` assigned at the same point that .isinsert, .isupdate, or .isdelete is assigned.
Class Variable is_ddl Undocumented
Class Variable is_sql Undocumented
Instance Variable can_execute Undocumented
Instance Variable dialect Undocumented
Instance Variable execution_options Undocumented
Instance Variable preparer Undocumented
Instance Variable schema_translate_map 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_compiler Return a Compiled that is capable of processing SQL expressions.
Class Method _init_compiler_cls Undocumented
Method _execute_on_connection Undocumented
Class Variable _cached_metadata Undocumented
Class Variable _result_columns Undocumented
Instance Variable _annotations Undocumented
Instance Variable _gen_time Generation time of this :class:`.Compiled`, used for reporting cache stats.
def __init__(self, dialect: 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`.

def __init_subclass__(cls): (source)

Undocumented

def __str__(self) -> str: (source)

Return the string text of the generated SQL or DDL.

def construct_params(self, params: 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.

def process(self, obj: Visitable, **kwargs: Any) -> str: (source)

Undocumented

def visit_unsupported_compilation(self, element, err, **kw): (source)

Undocumented

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.

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

dml_compile_state: Optional[CompileState] = (source)

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

can_execute = (source)

Undocumented

Undocumented

execution_options = (source)

Undocumented

preparer = (source)

Undocumented

schema_translate_map = (source)

Execution options propagated from the statement. In some cases, sub-elements of the statement can modify these.

description of the compiler's state

statement = (source)

The statement to compile.

The string representation of the ``statement``

Return the bind params for this compiled object.

@property
sql_compiler = (source)

Return a Compiled that is capable of processing SQL expressions. If this compiler is one, it would likely just return 'self'.

@classmethod
def _init_compiler_cls(cls): (source)

Undocumented

def _execute_on_connection(self, connection, distilled_params, execution_options): (source)

Undocumented

Undocumented

_annotations = (source)

Undocumented

_gen_time = (source)

Generation time of this :class:`.Compiled`, used for reporting cache stats.