class documentation

Undocumented

Method delete_extra_from_clause Render the DELETE .. USING clause specific to PostgreSQL.
Method fetch_clause Undocumented
Method for_update_clause Undocumented
Method format_from_hint_text Undocumented
Method get_select_precolumns Called when building a ``SELECT`` statement, position is just before column list.
Method limit_clause Undocumented
Method render_bind_cast Undocumented
Method render_literal_value Render the value of a bind parameter as a quoted literal.
Method update_from_clause Provide a hook to override the generation of an UPDATE..FROM clause.
Method visit_aggregate_order_by Undocumented
Method visit_array Undocumented
Method visit_bitwise_xor_op_binary Undocumented
Method visit_empty_set_expr Undocumented
Method visit_getitem_binary Undocumented
Method visit_ilike_case_insensitive_operand Undocumented
Method visit_ilike_op_binary Undocumented
Method visit_json_getitem_op_binary Undocumented
Method visit_json_path_getitem_op_binary Undocumented
Method visit_match_op_binary Undocumented
Method visit_not_ilike_op_binary Undocumented
Method visit_not_regexp_match_op_binary Undocumented
Method visit_on_conflict_do_nothing Undocumented
Method visit_on_conflict_do_update Undocumented
Method visit_phraseto_tsquery_func Undocumented
Method visit_plainto_tsquery_func Undocumented
Method visit_regexp_match_op_binary Undocumented
Method visit_regexp_replace_op_binary Undocumented
Method visit_sequence Undocumented
Method visit_slice Undocumented
Method visit_substring_func Undocumented
Method visit_to_tsquery_func Undocumented
Method visit_to_tsvector_func Undocumented
Method visit_ts_headline_func Undocumented
Method visit_websearch_to_tsquery_func Undocumented
Method _assert_pg_ts_ext Undocumented
Method _on_conflict_target Undocumented
Method _regexp_match Undocumented

Inherited from SQLCompiler:

Method __init__ Construct a new :class:`.SQLCompiler` object.
Method bindparam_string Undocumented
Method construct_expanded_state Return a new :class:`.ExpandedState` for a given parameter set.
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 delete_table_clause Undocumented
Method escape_literal_column Undocumented
Method function_argspec Undocumented
Method get_crud_hint_text Undocumented
Method get_cte_preamble Undocumented
Method get_from_hint_text Undocumented
Method get_render_as_alias_suffix Undocumented
Method get_select_hint_text Undocumented
Method get_statement_hint_text Undocumented
Method group_by_clause allow dialects to customize how GROUP BY is rendered.
Method is_subquery Undocumented
Method order_by_clause allow dialects to customize how ORDER BY is rendered.
Method post_process_text Undocumented
Method render_literal_bindparam Undocumented
Method returning_clause Undocumented
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.
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_expression_clauselist Undocumented
Method visit_extract Undocumented
Method visit_false Undocumented
Method visit_floordiv_binary 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_icontains_op_binary Undocumented
Method visit_iendswith_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_istartswith_op_binary 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_icontains_op_binary Undocumented
Method visit_not_iendswith_op_binary Undocumented
Method visit_not_in_op_binary Undocumented
Method visit_not_istartswith_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_scalar_values 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_truediv_binary 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 ansi_bind_rules SQL 92 doesn't allow bind parameters to be used in the columns clause of a SELECT, nor does it allow ambiguous expressions like "? = ?". A compiler subclass can set this flag to False if the target driver/DB enforces this...
Class Variable bindname_escape_characters A mapping (e.g. dict or similar) containing a lookup of characters keyed to replacement characters which will be applied to all 'bind names' used in SQL statements as a form of 'escaping'; the given characters are replaced entirely with the 'replacement' character when rendered in the SQL statement, and a similar translation is performed on the incoming names used in parameter dictionaries passed to methods like :meth:`_engine...
Class Variable implicit_returning list of "implicit" returning columns for a toplevel INSERT or UPDATE statement, used to receive newly generated values of columns.
Class Variable insert_prefetch list of columns for which default values should be evaluated before an INSERT takes place
Class Variable is_sql Undocumented
Class Variable literal_execute_params bindparameter objects that are rendered as literal values at statement execution time.
Class Variable post_compile_params bindparameter objects that are rendered as bound parameter placeholders at statement execution time.
Class Variable postfetch list of columns that can be post-fetched after INSERT or UPDATE to receive server-updated values
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
Class Variable update_prefetch list of columns for which onupdate default values should be evaluated before an UPDATE takes place
Instance Variable anon_map Undocumented
Instance Variable bind_names a dictionary of BindParameter instances to "compiled" names that are actually present in the generated SQL
Instance Variable binds a dictionary of bind parameter keys to BindParameter instances.
Instance Variable bindtemplate template to render bound parameters based on paramstyle.
Instance Variable cache_key The :class:`.CacheKey` that was generated ahead of creating this :class:`.Compiled` object.
Instance Variable column_keys Undocumented
Instance Variable compilation_bindtemplate template used by compiler to render parameters before positional paramstyle application
Instance Variable compile_state Optional :class:`.CompileState` object that maintains additional state used by the compiler.
Instance Variable ctes Undocumented
Instance Variable ctes_by_level_name Undocumented
Instance Variable ctes_recursive Undocumented
Instance Variable dml_compile_state Optional :class:`.CompileState` assigned at the same point that .isinsert, .isupdate, or .isdelete is assigned.
Instance Variable escaped_bind_names Undocumented
Instance Variable for_executemany Undocumented
Instance Variable from_linter Undocumented
Instance Variable has_out_parameters if True, there are bindparam() objects that have the isoutparam flag set.
Instance Variable inline Undocumented
Instance Variable isdelete 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 next_numeric_pos Undocumented
Instance Variable positional 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 stack major statements such as SELECT, INSERT, UPDATE, DELETE are tracked in this stack using an entry format.
Instance Variable string The string representation of the ``statement``
Instance Variable truncated_names Undocumented
Property current_executable Return the current 'executable' that is being compiled.
Property effective_returning The effective "returning" columns for INSERT, UPDATE or DELETE.
Property 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.
Property params Return the bind param dictionary embedded into this compiled object, for those values that are present.
Property prefetch Undocumented
Property returning backwards compatibility; returns the effective_returning collection.
Property sql_compiler Return a Compiled that is capable of processing SQL expressions.
Class Method _init_bind_translate Undocumented
Class Method _init_compiler_cls Undocumented
Method _add_to_result_map Undocumented
Method _anonymize Undocumented
Method _compose_select_body Undocumented
Method _create_result_map utility method used for unit tests only.
Method _deliver_insertmanyvalues_batches Undocumented
Method _dispatch_independent_ctes Undocumented
Method _display_froms_for_select Undocumented
Method _fallback_column_name 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 _insert_stmt_should_use_insertmanyvalues Undocumented
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_numeric Undocumented
Method _process_parameters_for_postcompile handle special post compile parameters.
Method _process_positional Undocumented
Method _render_cte_clause include_following_stack Also render the nesting CTEs on the next stack. Useful for SQL structures like UNION or INSERT that can wrap SELECT statements containing nesting CTEs.
Method _render_values Undocumented
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
Class Variable _bind_translate_chars Undocumented
Class Variable _bind_translate_re Undocumented
Class Variable _default_stack_entry Undocumented
Class Variable _get_bind_name_for_col Undocumented
Class Variable _insert_crud_params Undocumented
Class Variable _positional_pattern Undocumented
Class Variable _post_compile_pattern Undocumented
Class Variable _pyformat_pattern Undocumented
Class Variable _values_bindparam Undocumented
Class Variable _visited_bindparam Undocumented
Instance Variable _ad_hoc_textual tell the result that we encountered text() or '*' constructs in the middle of the result columns, but we also have compiled columns, so if the number of columns in cursor.description does not match how many expressions we have, that means we can't rely on positional at all and should match on name.
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 _insertmanyvalues Undocumented
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 _numeric_binds_identifier_char Character that's used to as the identifier of a numerical bind param. For example if this char is set to ``$``, numerical binds will be rendered in the form ``$1, $2, $3``.
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 _post_compile_expanded_state When render_postcompile is used, the ``ExpandedState`` used to create the "expanded" SQL is assigned here, and then used by the ``.params`` accessor and ``.construct_params()`` methods for their return values.
Instance Variable _pre_expanded_positiontup Undocumented
Instance Variable _pre_expanded_string Stores the original string SQL before 'post_compile' is applied, for cases where 'post_compile' were used.
Instance Variable _render_postcompile whether to render out POSTCOMPILE params during the compile phase.
Instance Variable _result_columns relates label names in the final SQL to a tuple of local column/label name, ColumnElement object (if any) and TypeEngine. CursorResult uses this for type processing and column targeting
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 _truncated_counters 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 _within_exec_param_key_getter Undocumented

Inherited from Compiled (via SQLCompiler):

Method __init_subclass__ Undocumented
Method __str__ Return the string text of the generated SQL or DDL.
Method process Undocumented
Method visit_unsupported_compilation Undocumented
Class Variable is_ddl 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.
Method _execute_on_connection Undocumented
Class Variable _cached_metadata Undocumented
Instance Variable _annotations Undocumented
Instance Variable _gen_time Generation time of this :class:`.Compiled`, used for reporting cache stats.
def delete_extra_from_clause(self, delete_stmt, from_table, extra_froms, from_hints, **kw): (source)

Render the DELETE .. USING clause specific to PostgreSQL.

def fetch_clause(self, select, **kw): (source)
def for_update_clause(self, select, **kw): (source)
def format_from_hint_text(self, sqltext, table, hint, iscrud): (source)
def get_select_precolumns(self, select, **kw): (source)

Called when building a ``SELECT`` statement, position is just before column list.

def limit_clause(self, select, **kw): (source)
def render_bind_cast(self, type_, dbapi_type, sqltext): (source)
def render_literal_value(self, value, type_): (source)

Render the value of a bind parameter as a quoted literal. This is used for statement sections that do not accept bind parameters on the target driver/database. This should be implemented by subclasses using the quoting services of the DBAPI.

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

Provide a hook to override the generation of an UPDATE..FROM clause. MySQL and MSSQL override this.

def visit_aggregate_order_by(self, element, **kw): (source)

Undocumented

def visit_array(self, element, **kw): (source)

Undocumented

def visit_bitwise_xor_op_binary(self, binary, operator, **kw): (source)

Undocumented

def visit_empty_set_expr(self, element_types, **kw): (source)
def visit_getitem_binary(self, binary, operator, **kw): (source)

Undocumented

def visit_ilike_case_insensitive_operand(self, element, **kw): (source)
def visit_ilike_op_binary(self, binary, operator, **kw): (source)
def visit_json_getitem_op_binary(self, binary, operator, _cast_applied=False, **kw): (source)

Undocumented

def visit_json_path_getitem_op_binary(self, binary, operator, _cast_applied=False, **kw): (source)

Undocumented

def visit_match_op_binary(self, binary, operator, **kw): (source)

Undocumented

def visit_not_ilike_op_binary(self, binary, operator, **kw): (source)
def visit_not_regexp_match_op_binary(self, binary, operator, **kw): (source)
def visit_on_conflict_do_nothing(self, on_conflict, **kw): (source)

Undocumented

def visit_on_conflict_do_update(self, on_conflict, **kw): (source)

Undocumented

def visit_phraseto_tsquery_func(self, element, **kw): (source)

Undocumented

def visit_plainto_tsquery_func(self, element, **kw): (source)

Undocumented

def visit_regexp_match_op_binary(self, binary, operator, **kw): (source)
def visit_regexp_replace_op_binary(self, binary, operator, **kw): (source)
def visit_sequence(self, seq, **kw): (source)
def visit_slice(self, element, **kw): (source)

Undocumented

def visit_substring_func(self, func, **kw): (source)

Undocumented

def visit_to_tsquery_func(self, element, **kw): (source)

Undocumented

def visit_to_tsvector_func(self, element, **kw): (source)

Undocumented

def visit_ts_headline_func(self, element, **kw): (source)

Undocumented

def visit_websearch_to_tsquery_func(self, element, **kw): (source)

Undocumented

def _assert_pg_ts_ext(self, element, **kw): (source)

Undocumented

def _on_conflict_target(self, clause, **kw): (source)

Undocumented

def _regexp_match(self, base_op, binary, operator, kw): (source)

Undocumented