|
10 | 10 | ) |
11 | 11 |
|
12 | 12 | from sqlalchemy import util |
| 13 | +from sqlalchemy.engine.cursor import CursorResult |
13 | 14 | from sqlalchemy.engine.interfaces import _CoreAnyExecuteParams |
14 | 15 | from sqlalchemy.engine.result import Result, ScalarResult, TupleResult |
15 | 16 | from sqlalchemy.orm import Query as _Query |
16 | 17 | from sqlalchemy.orm import Session as _Session |
17 | 18 | from sqlalchemy.orm._typing import OrmExecuteOptionsParameter |
18 | 19 | from sqlalchemy.sql._typing import _ColumnsClauseArgument |
19 | 20 | from sqlalchemy.sql.base import Executable as _Executable |
| 21 | +from sqlalchemy.sql.dml import UpdateBase |
20 | 22 | from sqlmodel.sql.base import Executable |
21 | 23 | from sqlmodel.sql.expression import Select, SelectOfScalar |
22 | 24 | from typing_extensions import deprecated |
@@ -52,30 +54,30 @@ def exec( |
52 | 54 | @overload |
53 | 55 | def exec( |
54 | 56 | self, |
55 | | - statement: _Executable, |
| 57 | + statement: UpdateBase, |
56 | 58 | *, |
57 | 59 | params: Optional[Union[Mapping[str, Any], Sequence[Mapping[str, Any]]]] = None, |
58 | 60 | execution_options: Mapping[str, Any] = util.EMPTY_DICT, |
59 | 61 | bind_arguments: Optional[Dict[str, Any]] = None, |
60 | 62 | _parent_execute_state: Optional[Any] = None, |
61 | 63 | _add_event: Optional[Any] = None, |
62 | | - ) -> Result[Any]: ... |
| 64 | + ) -> CursorResult[Any]: ... |
63 | 65 |
|
64 | 66 | def exec( |
65 | 67 | self, |
66 | 68 | statement: Union[ |
67 | 69 | Select[_TSelectParam], |
68 | 70 | SelectOfScalar[_TSelectParam], |
69 | 71 | Executable[_TSelectParam], |
70 | | - _Executable, |
| 72 | + UpdateBase, |
71 | 73 | ], |
72 | 74 | *, |
73 | 75 | params: Optional[Union[Mapping[str, Any], Sequence[Mapping[str, Any]]]] = None, |
74 | 76 | execution_options: Mapping[str, Any] = util.EMPTY_DICT, |
75 | 77 | bind_arguments: Optional[Dict[str, Any]] = None, |
76 | 78 | _parent_execute_state: Optional[Any] = None, |
77 | 79 | _add_event: Optional[Any] = None, |
78 | | - ) -> Union[TupleResult[_TSelectParam], ScalarResult[_TSelectParam], Result[Any]]: |
| 80 | + ) -> Union[TupleResult[_TSelectParam], ScalarResult[_TSelectParam], CursorResult[Any]]: |
79 | 81 | results = super().execute( |
80 | 82 | statement, |
81 | 83 | params=params, |
|
0 commit comments