Cursor strategy for a DML result that has no open cursor. This is a result set that does not return rows, i.e. for an INSERT, UPDATE, DELETE that does not include RETURNING.
| 1211 | |
| 1212 | |
| 1213 | class NoCursorDMLFetchStrategy(NoCursorFetchStrategy): |
| 1214 | """Cursor strategy for a DML result that has no open cursor. |
| 1215 | |
| 1216 | This is a result set that does not return rows, i.e. for an INSERT, |
| 1217 | UPDATE, DELETE that does not include RETURNING. |
| 1218 | |
| 1219 | """ |
| 1220 | |
| 1221 | __slots__ = () |
| 1222 | |
| 1223 | def _non_result( |
| 1224 | self, |
| 1225 | result: CursorResult[Unpack[TupleAny]], |
| 1226 | default: Any, |
| 1227 | err: Optional[BaseException] = None, |
| 1228 | ) -> Any: |
| 1229 | # we only expect to have a _NoResultMetaData() here right now. |
| 1230 | assert not result._metadata.returns_rows |
| 1231 | result._metadata._we_dont_return_rows(err) # type: ignore[union-attr] |
| 1232 | |
| 1233 | |
| 1234 | _NO_CURSOR_DML = NoCursorDMLFetchStrategy() |