class documentation

class StrSQLCompiler(SQLCompiler):

View In Hierarchy

A .SQLCompiler subclass which allows a small selection of non-standard SQL features to render into a string value.

The .StrSQLCompiler is invoked whenever a Core expression element is directly stringified without calling upon the _expression.ClauseElement.compile method. It can render a limited set of non-standard SQL constructs to assist in basic stringification, however for more substantial custom or dialect-specific SQL constructs, it will be necessary to make use of _expression.ClauseElement.compile directly.

Method delete​_extra​_from​_clause Provide a hook to override the generation of an DELETE..FROM clause.
Method update​_from​_clause Provide a hook to override the generation of an UPDATE..FROM clause.
Method ​_fallback​_column​_name Undocumented
Method get​_from​_hint​_text Undocumented
Method returning​_clause Undocumented
Method visit​_empty​_set​_expr Undocumented
Method visit​_getitem​_binary Undocumented
Method visit​_json​_getitem​_op​_binary Undocumented
Method visit​_json​_path​_getitem​_op​_binary Undocumented
Method visit​_not​_regexp​_match​_op​_binary Undocumented
Method visit​_regexp​_match​_op​_binary Undocumented
Method visit​_regexp​_replace​_op​_binary Undocumented
Method visit​_sequence Undocumented
Method visit​_unsupported​_compilation Undocumented

Inherited from SQLCompiler:

Method __init__ Construct a new .SQLCompiler object.
Method construct​_params return a dictionary of bind parameter keys and values
Method default​_from Called when a SELECT statement has no froms, and no FROM clause is to be appended.
Method get​_select​_precolumns Called when building a SELECT statement, position is just before column list.
Method group​_by​_clause allow dialects to customize how GROUP BY is rendered.
Method order​_by​_clause allow dialects to customize how ORDER BY is rendered.
Method render​_literal​_value Render the value of a bind parameter as a quoted literal.
Method update​_limit​_clause Provide a hook for MySQL to add LIMIT to the UPDATE
Method update​_tables​_clause Provide a hook to override the initial table clause in an UPDATE statement.
Class Variable ansi​_bind​_rules No summary
Class Variable insert​_single​_values​_expr When an INSERT is compiled with a single set of parameters inside a VALUES expression, the string is assigned here, where it can be used for insert batching schemes to rewrite the VALUES expression.
Class Variable literal​_execute​_params bindparameter objects that are rendered as literal values at statement execution time.
Class Variable postfetch​_lastrowid if True, and this in insert, use cursor.lastrowid to populate result.inserted_primary_key.
Class Variable render​_table​_with​_column​_in​_update​_from set to True classwide to indicate the SET clause in a multi-table UPDATE statement should qualify columns with the table name (i.e. MySQL only)
Class Variable returning​_precedes​_values set to True classwide to generate RETURNING clauses before the VALUES or WHERE clause (i.e. MSSQL)
Class Variable translate​_select​_structure if not None, should be a callable which accepts (select_stmt, **kw) and returns a select object. this is used for structural changes mostly to accommodate for LIMIT/OFFSET schemes
Instance Variable escaped​_bind​_names Undocumented
Instance Variable has​_out​_parameters if True, there are bindparam() objects that have the isoutparam flag set.
Instance Variable isdelete Undocumented
Instance Variable positiontup for a compiled construct that uses a positional paramstyle, will be a sequence of strings, indicating the names of bound parameters in order.
Instance Variable post​_compile​_params bindparameter objects that are rendered as bound parameter placeholders at statement execution time.
Instance Variable returning holds the "returning" collection of columns if the statement is CRUD and defines returning columns either implicitly or explicitly
Method ​_add​_to​_result​_map Undocumented
Method ​_anonymize Undocumented
Method ​_apply​_numbered​_params Undocumented
Method ​_compose​_select​_body Undocumented
Method ​_create​_result​_map utility method used for unit tests only.
Method ​_display​_froms​_for​_select Undocumented
Method ​_format​_frame​_clause Undocumented
Method ​_generate​_delimited​_and​_list Undocumented
Method ​_generate​_delimited​_list Undocumented
Method ​_generate​_generic​_binary Undocumented
Method ​_generate​_generic​_unary​_modifier Undocumented
Method ​_generate​_generic​_unary​_operator Undocumented
Method ​_generate​_prefixes Undocumented
Method ​_get​_operator​_dispatch Undocumented
Method ​_get​_set​_input​_sizes​_lookup Undocumented
Method ​_init​_cte​_state Initialize collections related to CTEs only if a CTE is located, to save on the overhead of these collections otherwise.
Method ​_label​_returning​_column Render a column with necessary labels inside of a RETURNING clause.
Method ​_label​_select​_column produce labeled columns present in a select().
Method ​_literal​_execute​_expanding​_parameter Undocumented
Method ​_literal​_execute​_expanding​_parameter​_literal​_binds Undocumented
Method ​_nested​_result special API to support the use case of 'nested result sets'
Method ​_process​_parameters​_for​_postcompile handle special post compile parameters.
Method ​_render​_cte​_clause No summary
Method ​_row​_limit​_clause Undocumented
Method ​_setup​_crud​_hints Undocumented
Method ​_setup​_select​_hints Undocumented
Method ​_setup​_select​_stack Undocumented
Method ​_truncate​_bindparam Undocumented
Method ​_truncated​_identifier Undocumented
Method bindparam​_string Undocumented
Method delete​_table​_clause Undocumented
Method escape​_literal​_column Undocumented
Method fetch​_clause Undocumented
Method for​_update​_clause Undocumented
Method format​_from​_hint​_text Undocumented
Method function​_argspec Undocumented
Method get​_crud​_hint​_text Undocumented
Method get​_cte​_preamble Undocumented
Method get​_render​_as​_alias​_suffix Undocumented
Method get​_select​_hint​_text Undocumented
Method get​_statement​_hint​_text Undocumented
Method is​_subquery Undocumented
Method limit​_clause Undocumented
Method post​_process​_text Undocumented
Method render​_literal​_bindparam Undocumented
Method visit​_alias Undocumented
Method visit​_between​_op​_binary Undocumented
Method visit​_binary Undocumented
Method visit​_bindparam Undocumented
Method visit​_case Undocumented
Method visit​_cast Undocumented
Method visit​_clauselist Undocumented
Method visit​_collation Undocumented
Method visit​_column Undocumented
Method visit​_compound​_select Undocumented
Method visit​_contains​_op​_binary Undocumented
Method visit​_cte Undocumented
Method visit​_custom​_op​_binary Undocumented
Method visit​_custom​_op​_unary​_modifier Undocumented
Method visit​_custom​_op​_unary​_operator Undocumented
Method visit​_delete Undocumented
Method visit​_empty​_set​_op​_expr Undocumented
Method visit​_endswith​_op​_binary Undocumented
Method visit​_extract Undocumented
Method visit​_false Undocumented
Method visit​_fromclause Undocumented
Method visit​_funcfilter Undocumented
Method visit​_function Undocumented
Method visit​_function​_as​_comparison​_op​_binary Undocumented
Method visit​_grouping Undocumented
Method visit​_ilike​_op​_binary Undocumented
Method visit​_index Undocumented
Method visit​_insert Undocumented
Method visit​_is​_false​_unary​_operator Undocumented
Method visit​_is​_true​_unary​_operator Undocumented
Method visit​_join Undocumented
Method visit​_label Undocumented
Method visit​_label​_reference Undocumented
Method visit​_lambda​_element Undocumented
Method visit​_lateral Undocumented
Method visit​_like​_op​_binary Undocumented
Method visit​_mod​_binary Undocumented
Method visit​_next​_value​_func Undocumented
Method visit​_not​_between​_op​_binary Undocumented
Method visit​_not​_contains​_op​_binary Undocumented
Method visit​_not​_endswith​_op​_binary Undocumented
Method visit​_not​_ilike​_op​_binary Undocumented
Method visit​_not​_in​_op​_binary Undocumented
Method visit​_not​_like​_op​_binary Undocumented
Method visit​_not​_match​_op​_binary Undocumented
Method visit​_not​_startswith​_op​_binary Undocumented
Method visit​_null Undocumented
Method visit​_over Undocumented
Method visit​_release​_savepoint Undocumented
Method visit​_rollback​_to​_savepoint Undocumented
Method visit​_savepoint Undocumented
Method visit​_scalar​_function​_column Undocumented
Method visit​_select Undocumented
Method visit​_select​_statement​_grouping Undocumented
Method visit​_startswith​_op​_binary Undocumented
Method visit​_subquery Undocumented
Method visit​_table Undocumented
Method visit​_table​_valued​_alias Undocumented
Method visit​_table​_valued​_column Undocumented
Method visit​_tablesample Undocumented
Method visit​_textclause Undocumented
Method visit​_textual​_label​_reference Undocumented
Method visit​_textual​_select Undocumented
Method visit​_true Undocumented
Method visit​_tuple Undocumented
Method visit​_type​_coerce Undocumented
Method visit​_typeclause Undocumented
Method visit​_unary Undocumented
Method visit​_update Undocumented
Method visit​_values Undocumented
Method visit​_withingroup Undocumented
Class Variable ​_default​_stack​_entry Undocumented
Class Variable insert​_prefetch Undocumented
Class Variable update​_prefetch Undocumented
Instance Variable ​_cache​_key​_bind​_match a mapping that will relate the BindParameter object we compile to those that are part of the extracted collection of parameters in the cache key, if we were given a cache key.
Instance Variable ​_loose​_column​_name​_matching tell the result object that the SQL statement is textual, wants to match up to Column objects, and may be using the ._tq_label in the SELECT rather than the base name.
Instance Variable ​_numeric​_binds True if paramstyle is "numeric". This paramstyle is trickier than all the others.
Instance Variable ​_ordered​_columns if False, means we can't be sure the list of entries in _result_columns is actually the rendered order. Usually True unless using an unordered TextualSelect.
Instance Variable ​_render​_postcompile whether to render out POSTCOMPILE params during the compile phase.
Instance Variable ​_result​_columns Undocumented
Instance Variable ​_textual​_ordered​_columns tell the result object that the column names as rendered are important, but they are also "ordered" vs. what is in the compiled object here.
Instance Variable anon​_map Undocumented
Instance Variable bind​_names Undocumented
Instance Variable binds Undocumented
Instance Variable bindtemplate Undocumented
Instance Variable cache​_key Undocumented
Instance Variable column​_keys Undocumented
Instance Variable compile​_state Optional .CompileState object that maintains additional state used by the compiler.
Instance Variable cte​_positional Undocumented
Instance Variable ctes Undocumented
Instance Variable ctes​_by​_level​_name Undocumented
Instance Variable ctes​_recursive Undocumented
Instance Variable execution​_options Undocumented
Instance Variable for​_executemany Undocumented
Instance Variable from​_linter Undocumented
Instance Variable inline Undocumented
Instance Variable isinsert Undocumented
Instance Variable isplaintext Undocumented
Instance Variable isupdate class-level defaults which can be set at the instance level to define if this Compiled instance represents INSERT/UPDATE/DELETE
Instance Variable label​_length Undocumented
Instance Variable level​_name​_by​_cte Undocumented
Instance Variable linting Undocumented
Instance Variable positional Undocumented
Instance Variable stack Undocumented
Instance Variable string Undocumented
Instance Variable truncated​_names Undocumented
Property ​_bind​_processors Undocumented
Property ​_global​_attributes Undocumented
Property ​_inserted​_primary​_key​_from​_lastrowid​_getter Undocumented
Property ​_inserted​_primary​_key​_from​_returning​_getter Undocumented
Property ​_like​_percent​_literal Undocumented
Property current​_executable Return the current 'executable' that is being compiled.
Property params Return the bind param dictionary embedded into this compiled object, for those values that are present.
Property prefetch Undocumented
Property sql​_compiler Return a Compiled that is capable of processing SQL expressions.

Inherited from Compiled (via SQLCompiler):

Method __str__ Return the string text of the generated SQL or DDL.
Method ​_execute​_on​_connection Undocumented
Method process Undocumented
Class Variable ​_cached​_metadata Undocumented
Instance Variable ​_annotations Undocumented
Instance Variable ​_gen​_time Undocumented
Instance Variable can​_execute Undocumented
Instance Variable dialect Undocumented
Instance Variable preparer Undocumented
Instance Variable schema​_translate​_map Undocumented
Instance Variable statement Undocumented
def delete_extra_from_clause(self, update_stmt, from_table, extra_froms, from_hints, **kw):

Provide a hook to override the generation of an DELETE..FROM clause.

This can be used to implement DELETE..USING for example.

MySQL and MSSQL override this.

def update_from_clause(self, update_stmt, from_table, extra_froms, from_hints, **kw):

Provide a hook to override the generation of an UPDATE..FROM clause.

MySQL and MSSQL override this.

def _fallback_column_name(self, column):
def get_from_hint_text(self, table, text):
def returning_clause(self, stmt, returning_cols):
def visit_empty_set_expr(self, type_):
def visit_getitem_binary(self, binary, operator, **kw):

Undocumented

def visit_json_getitem_op_binary(self, binary, operator, **kw):

Undocumented

def visit_json_path_getitem_op_binary(self, binary, operator, **kw):

Undocumented

def visit_not_regexp_match_op_binary(self, binary, operator, **kw):
def visit_regexp_match_op_binary(self, binary, operator, **kw):
def visit_regexp_replace_op_binary(self, binary, operator, **kw):
def visit_sequence(self, seq, **kw):
@util.preload_module('sqlalchemy.engine.url')
def visit_unsupported_compilation(self, element, err, **kw):