class documentation

class Compiled(object):

Known subclasses: sqlalchemy.sql.compiler.DDLCompiler, sqlalchemy.sql.compiler.SQLCompiler

View In Hierarchy

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 .Compiled object.
Method __str__ Return the string text of the generated SQL or DDL.
Method ​_execute​_on​_connection Undocumented
Method construct​_params Return the bind params for this compiled object.
Method process Undocumented
Method visit​_unsupported​_compilation Undocumented
Class Variable ​_cached​_metadata Undocumented
Class Variable ​_result​_columns Undocumented
Class Variable cache​_key Undocumented
Class Variable compile​_state Optional .CompileState object that maintains additional state used by the compiler.
Instance Variable ​_annotations Undocumented
Instance Variable ​_gen​_time Undocumented
Instance Variable can​_execute Undocumented
Instance Variable dialect Undocumented
Instance Variable execution​_options Undocumented
Instance Variable preparer Undocumented
Instance Variable schema​_translate​_map Undocumented
Instance Variable statement Undocumented
Instance Variable string Undocumented
Property params Return the bind params for this compiled object.
Property sql​_compiler Return a Compiled that is capable of processing SQL expressions.
def __init__(self, dialect, statement, schema_translate_map=None, render_schema_translate=False, compile_kwargs=util.immutabledict()):
Construct a new .Compiled object.
Parameters
dialect.Dialect to compile against.
statement_expression.ClauseElement to be compiled.
schema​_translate​_map

dictionary of schema names to be translated when forming the resultant SQL

New in version 1.1.
render​_schema​_translateUndocumented
compile​_kwargsadditional kwargs that will be passed to the initial call to .Compiled.process.
def __str__(self):
Return the string text of the generated SQL or DDL.
def _execute_on_connection(self, connection, multiparams, params, execution_options):

Undocumented

def construct_params(self, params=None, extracted_parameters=None):
Return the bind params for this compiled object.
Parameters
paramsa dict of string/object pairs whose values will override bind values compiled in to the statement.
extracted​_parametersUndocumented
def process(self, obj, **kwargs):

Undocumented

def visit_unsupported_compilation(self, element, err):

Undocumented

_cached_metadata =

Undocumented

_result_columns =

Undocumented

cache_key =

Undocumented

compile_state =

Optional .CompileState object that maintains additional state used by the compiler.

Major executable objects such as _expression.Insert, _expression.Update, _expression.Delete, _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.

New in version 1.4.
_annotations =

Undocumented

_gen_time =

Undocumented

can_execute =

Undocumented

dialect =

Undocumented

execution_options =

Undocumented

preparer =

Undocumented

schema_translate_map =

Undocumented

statement =

Undocumented

string =

Undocumented

@property
params =
Return the bind params for this compiled object.
@property
sql_compiler =

Return a Compiled that is capable of processing SQL expressions.

If this compiler is one, it would likely just return 'self'.