MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / postfetch_cols

Method postfetch_cols

lib/sqlalchemy/engine/cursor.py:2150–2171  ·  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

2148 return self.context.lastrow_has_defaults()
2149
2150 def postfetch_cols(self) -> Optional[Sequence[Column[Any]]]:
2151 """Return ``postfetch_cols()`` from the underlying
2152 :class:`.ExecutionContext`.
2153
2154 See :class:`.ExecutionContext` for details.
2155
2156 Raises :class:`~sqlalchemy.exc.InvalidRequestError` if the executed
2157 statement is not a compiled expression construct
2158 or is not an insert() or update() construct.
2159
2160 """
2161
2162 if not self.context.compiled:
2163 raise exc.InvalidRequestError(
2164 "Statement is not a compiled expression construct."
2165 )
2166 elif not self.context.isinsert and not self.context.isupdate:
2167 raise exc.InvalidRequestError(
2168 "Statement is not an insert() or update() "
2169 "expression construct."
2170 )
2171 return self.context.postfetch_cols
2172
2173 def prefetch_cols(self) -> Optional[Sequence[Column[Any]]]:
2174 """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