|
17 | 17 | from sqlalchemy.orm._typing import OrmExecuteOptionsParameter
|
18 | 18 | from sqlalchemy.sql._typing import _ColumnsClauseArgument
|
19 | 19 | from sqlalchemy.sql.base import Executable as _Executable
|
| 20 | +from sqlalchemy.sql import Delete |
20 | 21 | from sqlmodel.sql.base import Executable
|
21 | 22 | from sqlmodel.sql.expression import Select, SelectOfScalar
|
22 | 23 | from typing_extensions import deprecated
|
@@ -49,20 +50,34 @@ def exec(
|
49 | 50 | _add_event: Optional[Any] = None,
|
50 | 51 | ) -> ScalarResult[_TSelectParam]: ...
|
51 | 52 |
|
| 53 | + @overload |
| 54 | + def exec( |
| 55 | + self, |
| 56 | + statement: Delete[_TSelectParam], |
| 57 | + *, |
| 58 | + params: Optional[Union[Mapping[str, Any], Sequence[Mapping[str, Any]]]] = None, |
| 59 | + execution_options: Mapping[str, Any] = util.EMPTY_DICT, |
| 60 | + bind_arguments: Optional[Dict[str, Any]] = None, |
| 61 | + _parent_execute_state: Optional[Any] = None, |
| 62 | + _add_event: Optional[Any] = None, |
| 63 | + ) -> None: |
| 64 | + ... |
| 65 | + |
52 | 66 | def exec(
|
53 | 67 | self,
|
54 | 68 | statement: Union[
|
55 | 69 | Select[_TSelectParam],
|
56 | 70 | SelectOfScalar[_TSelectParam],
|
57 | 71 | Executable[_TSelectParam],
|
| 72 | + Delete[_TSelectParam], |
58 | 73 | ],
|
59 | 74 | *,
|
60 | 75 | params: Optional[Union[Mapping[str, Any], Sequence[Mapping[str, Any]]]] = None,
|
61 | 76 | execution_options: Mapping[str, Any] = util.EMPTY_DICT,
|
62 | 77 | bind_arguments: Optional[Dict[str, Any]] = None,
|
63 | 78 | _parent_execute_state: Optional[Any] = None,
|
64 | 79 | _add_event: Optional[Any] = None,
|
65 |
| - ) -> Union[TupleResult[_TSelectParam], ScalarResult[_TSelectParam]]: |
| 80 | + ) -> Union[TupleResult[_TSelectParam], ScalarResult[_TSelectParam], None]: |
66 | 81 | results = super().execute(
|
67 | 82 | statement,
|
68 | 83 | params=params,
|
|
0 commit comments