Undocumented
Class |
|
No class docstring; 0/5 instance variable, 0/3 class variable, 5/11 methods, 0/2 class method documented |
Class |
|
No class docstring; 0/9 instance variable, 0/2 class variable, 2/4 methods documented |
Class |
|
A LambdaElement where the lambda accepts arguments and is invoked within the compile phase with special context. |
Class |
|
A SQL construct where the state is stored as an un-invoked lambda. |
Class |
|
Undocumented |
Class |
|
Represent subsequent links of a :class:`.StatementLambdaElement`. |
Class |
|
Undocumented |
Class |
|
Provides the :class:`.StatementLambdaElement` API but does not cache or analyze lambdas. |
Class |
|
A wrapper object that is injected into the ``__globals__`` and ``__closure__`` of a Python function. |
Class |
|
Represent a composable SQL statement as a :class:`_sql.LambdaElement`. |
Function | insp |
Undocumented |
Function | lambda |
Produce a SQL statement that is cached as a lambda. |
Type Variable | _E |
Undocumented |
Type Alias | _ |
Undocumented |
Type Alias | _ |
Undocumented |
Type Alias | _ |
Undocumented |
Type Alias | _ |
Undocumented |
Type Alias | _ |
Undocumented |
Type Alias | _ |
Undocumented |
Variable | _closure |
Undocumented |
_StmtLambdaType
, enable_tracking: bool
= True, track_closure_variables: bool
= True, track_on: Optional[ object]
= None, global_track_bound_values: bool
= True, track_bound_values: bool
= True, lambda_cache: Optional[ _LambdaCacheType]
= None) -> StatementLambdaElement
:
(source)
¶
Produce a SQL statement that is cached as a lambda. The Python code object within the lambda is scanned for both Python literals that will become bound parameters as well as closure variables that refer to Core or ORM constructs that may vary. The lambda itself will be invoked only once per particular set of constructs detected. E.g.:: from sqlalchemy import lambda_stmt stmt = lambda_stmt(lambda: table.select()) stmt += lambda s: s.where(table.c.id == 5) result = connection.execute(stmt) The object returned is an instance of :class:`_sql.StatementLambdaElement`. .. versionadded:: 1.4 :param lmb: a Python function, typically a lambda, which takes no arguments and returns a SQL expression construct :param enable_tracking: when False, all scanning of the given lambda for changes in closure variables or bound parameters is disabled. Use for a lambda that produces the identical results in all cases with no parameterization. :param track_closure_variables: when False, changes in closure variables within the lambda will not be scanned. Use for a lambda where the state of its closure variables will never change the SQL structure returned by the lambda. :param track_bound_values: when False, bound parameter tracking will be disabled for the given lambda. Use for a lambda that either does not produce any bound values, or where the initial bound values never change. :param global_track_bound_values: when False, bound parameter tracking will be disabled for the entire statement including additional links added via the :meth:`_sql.StatementLambdaElement.add_criteria` method. :param lambda_cache: a dictionary or other mapping-like object where information about the lambda's Python code as well as the tracked closure variables in the lambda itself will be stored. Defaults to a global LRU cache. This cache is independent of the "compiled_cache" used by the :class:`_engine.Connection` object. .. seealso:: :ref:`engine_lambda_caching`
Undocumented
Value |
|