Return ``postfetch_cols()`` from the underlying :class:`.ExecutionContext`. See :class:`.ExecutionContext` for details. Raises :class:`~sqlalchemy.exc.InvalidRequestError` if the executed statement is not a compiled expression construct or is not an insert()
(self)
| 2032 | return self.context.lastrow_has_defaults() |
| 2033 | |
| 2034 | def postfetch_cols(self) -> Optional[Sequence[Column[Any]]]: |
| 2035 | """Return ``postfetch_cols()`` from the underlying |
| 2036 | :class:`.ExecutionContext`. |
| 2037 | |
| 2038 | See :class:`.ExecutionContext` for details. |
| 2039 | |
| 2040 | Raises :class:`~sqlalchemy.exc.InvalidRequestError` if the executed |
| 2041 | statement is not a compiled expression construct |
| 2042 | or is not an insert() or update() construct. |
| 2043 | |
| 2044 | """ |
| 2045 | |
| 2046 | if not self.context.compiled: |
| 2047 | raise exc.InvalidRequestError( |
| 2048 | "Statement is not a compiled expression construct." |
| 2049 | ) |
| 2050 | elif not self.context.isinsert and not self.context.isupdate: |
| 2051 | raise exc.InvalidRequestError( |
| 2052 | "Statement is not an insert() or update() " |
| 2053 | "expression construct." |
| 2054 | ) |
| 2055 | return self.context.postfetch_cols |
| 2056 | |
| 2057 | def prefetch_cols(self) -> Optional[Sequence[Column[Any]]]: |
| 2058 | """Return ``prefetch_cols()`` from the underlying |
no outgoing calls