MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / postfetch_cols

Method postfetch_cols

lib/sqlalchemy/engine/cursor.py:2034–2055  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 4

test_seq_nonpkMethod · 0.45
test_empty_accessorsMethod · 0.45

Calls

no outgoing calls

Tested by 2

test_seq_nonpkMethod · 0.36
test_empty_accessorsMethod · 0.36