module documentation

Functions used by compiler.py to determine the parameters rendered within INSERT and UPDATE statements.

Constant REQUIRED Undocumented
Class _CrudParams Undocumented
Class _multiparam_column Undocumented
Function _append_param_insert_hasdefault Undocumented
Function _append_param_insert_pk_no_returning Create a primary key expression in the INSERT statement where we want to populate result.inserted_primary_key and we cannot use RETURNING.
Function _append_param_insert_pk_returning Create a primary key expression in the INSERT statement where we want to populate result.inserted_primary_key and RETURNING is available.
Function _append_param_insert_select_hasdefault Undocumented
Function _append_param_parameter Undocumented
Function _append_param_update Undocumented
Function _as_dml_column Undocumented
Function _create_bind_param Undocumented
Function _create_insert_prefetch_bind_param Undocumented
Function _create_update_prefetch_bind_param Undocumented
Function _extend_values_for_multiparams Undocumented
Function _get_crud_params create a set of tuples representing column/string pairs for use in an INSERT or UPDATE statement.
Function _get_returning_modifiers determines RETURNING strategy, if any, for the statement.
Function _get_stmt_parameter_tuples_params Undocumented
Function _get_update_multitable_params Undocumented
Function _handle_values_anonymous_param Undocumented
Function _key_getters_for_crud_column Undocumented
Function _process_multiparam_default_bind Undocumented
Function _scan_cols Undocumented
Function _scan_insert_from_select_cols Undocumented
Function _setup_delete_return_defaults Undocumented
Function _warn_pk_with_no_anticipated_value Undocumented
Type Alias _CrudParamElement Undocumented
Type Alias _CrudParamElementSQLExpr Undocumented
Type Alias _CrudParamElementStr Undocumented
Type Alias _CrudParamSequence Undocumented
REQUIRED = (source)

Undocumented

Value
util.symbol('REQUIRED',
            '''
Placeholder for the value within a :class:`.BindParameter`
which is required to be present when the statement is passed
to :meth:`_engine.Connection.execute`.

This symbol is typically used when a :func:`_expression.insert`
...
def _append_param_insert_hasdefault(compiler, stmt, c, implicit_return_defaults, values, kw): (source)

Undocumented

def _append_param_insert_pk_no_returning(compiler, stmt, c, values, kw): (source)

Create a primary key expression in the INSERT statement where we want to populate result.inserted_primary_key and we cannot use RETURNING. Depending on the kind of default here we may create a bound parameter in the INSERT statement and pre-execute a default generation function, or we may use cursor.lastrowid if supported by the dialect.

def _append_param_insert_pk_returning(compiler, stmt, c, values, kw): (source)

Create a primary key expression in the INSERT statement where we want to populate result.inserted_primary_key and RETURNING is available.

def _append_param_insert_select_hasdefault(compiler: SQLCompiler, stmt: ValuesBase, c: ColumnClause[Any], values: List[_CrudParamElementSQLExpr], kw: Dict[str, Any]): (source)

Undocumented

def _append_param_parameter(compiler, stmt, compile_state, c, col_key, parameters, _col_bind_name, implicit_returning, implicit_return_defaults, postfetch_lastrowid, values, autoincrement_col, insert_null_pk_still_autoincrements, kw): (source)

Undocumented

def _append_param_update(compiler, compile_state, stmt, c, implicit_return_defaults, values, kw): (source)

Undocumented

def _as_dml_column(c: ColumnElement[Any]) -> ColumnClause[Any]: (source)

Undocumented

@overload
def _create_bind_param(compiler: SQLCompiler, col: ColumnElement[Any], value: Any, process: Literal[True] = ..., required: bool = False, name: Optional[str] = None, **kw: Any) -> str:
@overload
def _create_bind_param(compiler: SQLCompiler, col: ColumnElement[Any], value: Any, **kw: Any) -> str:
(source)

Undocumented

@overload
def _create_insert_prefetch_bind_param(compiler: SQLCompiler, c: ColumnElement[Any], process: Literal[True] = ..., **kw: Any) -> str:
@overload
def _create_insert_prefetch_bind_param(compiler: SQLCompiler, c: ColumnElement[Any], process: Literal[False], **kw: Any) -> elements.BindParameter[Any]:
(source)

Undocumented

@overload
def _create_update_prefetch_bind_param(compiler: SQLCompiler, c: ColumnElement[Any], process: Literal[True] = ..., **kw: Any) -> str:
@overload
def _create_update_prefetch_bind_param(compiler: SQLCompiler, c: ColumnElement[Any], process: Literal[False], **kw: Any) -> elements.BindParameter[Any]:
(source)

Undocumented

def _extend_values_for_multiparams(compiler: SQLCompiler, stmt: ValuesBase, compile_state: DMLState, initial_values: Sequence[_CrudParamElementStr], _column_as_key: Callable[..., str], kw: Dict[str, Any]) -> List[Sequence[_CrudParamElementStr]]: (source)

Undocumented

def _get_crud_params(compiler: SQLCompiler, stmt: ValuesBase, compile_state: DMLState, toplevel: bool, **kw: Any) -> _CrudParams: (source)

create a set of tuples representing column/string pairs for use in an INSERT or UPDATE statement. Also generates the Compiled object's postfetch, prefetch, and returning column collections, used for default handling and ultimately populating the CursorResult's prefetch_cols() and postfetch_cols() collections.

def _get_returning_modifiers(compiler, stmt, compile_state, toplevel): (source)

determines RETURNING strategy, if any, for the statement. This is where it's determined what we need to fetch from the INSERT or UPDATE statement after it's invoked.

def _get_stmt_parameter_tuples_params(compiler, compile_state, parameters, stmt_parameter_tuples, _column_as_key, values, kw): (source)

Undocumented

def _get_update_multitable_params(compiler, stmt, compile_state, stmt_parameter_tuples, check_columns, _col_bind_name, _getattr_col_key, values, kw): (source)

Undocumented

def _handle_values_anonymous_param(compiler, col, value, name, **kw): (source)

Undocumented

def _key_getters_for_crud_column(compiler: SQLCompiler, stmt: ValuesBase, compile_state: DMLState) -> Tuple[Callable[[Union[str, ColumnClause[Any]]], Union[str, Tuple[str, str]]], Callable[[ColumnClause[Any]], Union[str, Tuple[str, str]]], _BindNameForColProtocol]: (source)

Undocumented

def _process_multiparam_default_bind(compiler: SQLCompiler, stmt: ValuesBase, c: KeyedColumnElement[Any], index: int, kw: Dict[str, Any]) -> str: (source)

Undocumented

def _scan_cols(compiler, stmt, compile_state, parameters, _getattr_col_key, _column_as_key, _col_bind_name, check_columns, values, toplevel, kw): (source)

Undocumented

def _scan_insert_from_select_cols(compiler, stmt, compile_state, parameters, _getattr_col_key, _column_as_key, _col_bind_name, check_columns, values, toplevel, kw): (source)

Undocumented

def _setup_delete_return_defaults(compiler, stmt, compile_state, parameters, _getattr_col_key, _column_as_key, _col_bind_name, check_columns, values, toplevel, kw): (source)

Undocumented

def _warn_pk_with_no_anticipated_value(c): (source)

Undocumented

_CrudParamElement = (source)

Undocumented

Value
Tuple['ColumnElement[Any]',
      str,
      Optional[Union[str, '_SQLExprDefault']],
      Iterable[str]]
_CrudParamElementSQLExpr = (source)

Undocumented

Value
Tuple['ColumnClause[Any]', str, '_SQLExprDefault', Iterable[str]]
_CrudParamElementStr = (source)

Undocumented

Value
Tuple['KeyedColumnElement[Any]', str, str, Iterable[str]]
_CrudParamSequence = (source)

Undocumented

Value
List[_CrudParamElement]