Add a compile state function to this statement. When using the ORM only, these are callable functions that will be given the CompileState object upon compilation. A second argument cache_args is required, which will be combined with the ``__code__`` identity of the
(
self,
callable_: Callable[[CompileState], None],
cache_args: Any,
)
| 1448 | |
| 1449 | @_generative |
| 1450 | def _add_compile_state_func( |
| 1451 | self, |
| 1452 | callable_: Callable[[CompileState], None], |
| 1453 | cache_args: Any, |
| 1454 | ) -> Self: |
| 1455 | """Add a compile state function to this statement. |
| 1456 | |
| 1457 | When using the ORM only, these are callable functions that will |
| 1458 | be given the CompileState object upon compilation. |
| 1459 | |
| 1460 | A second argument cache_args is required, which will be combined with |
| 1461 | the ``__code__`` identity of the function itself in order to produce a |
| 1462 | cache key. |
| 1463 | |
| 1464 | """ |
| 1465 | self._compile_state_funcs += ((callable_, cache_args),) |
| 1466 | return self |
| 1467 | |
| 1468 | @overload |
| 1469 | def execution_options( |
no outgoing calls