MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / NullLambdaStatement

Class NullLambdaStatement

lib/sqlalchemy/sql/lambdas.py:654–698  ·  view source on GitHub ↗

Provides the :class:`.StatementLambdaElement` API but does not cache or analyze lambdas. the lambdas are instead invoked immediately. The intended use is to isolate issues that may arise when using lambda statements.

Source from the content-addressed store, hash-verified

652
653
654class NullLambdaStatement(roles.AllowsLambdaRole, elements.ClauseElement):
655 """Provides the :class:`.StatementLambdaElement` API but does not
656 cache or analyze lambdas.
657
658 the lambdas are instead invoked immediately.
659
660 The intended use is to isolate issues that may arise when using
661 lambda statements.
662
663 """
664
665 __visit_name__ = "lambda_element"
666
667 _is_lambda_element = True
668
669 _traverse_internals = [
670 ("_resolved", visitors.InternalTraversal.dp_clauseelement)
671 ]
672
673 def __init__(self, statement):
674 self._resolved = statement
675 self._propagate_attrs = statement._propagate_attrs
676
677 def __getattr__(self, key):
678 return getattr(self._resolved, key)
679
680 def __add__(self, other):
681 statement = other(self._resolved)
682
683 return NullLambdaStatement(statement)
684
685 def add_criteria(self, other, **kw):
686 statement = other(self._resolved)
687
688 return NullLambdaStatement(statement)
689
690 def _execute_on_connection(
691 self, connection, distilled_params, execution_options
692 ):
693 if self._resolved.supports_execution:
694 return connection._execute_clauseelement(
695 self, distilled_params, execution_options
696 )
697 else:
698 raise exc.ObjectNotExecutableError(self)
699
700
701class LinkedLambdaElement(StatementLambdaElement):

Callers 3

spoilMethod · 0.85
__add__Method · 0.85
add_criteriaMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected