FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

✨ Add overload for `exec` method to support `text` statement by YuriiMotov · Pull Request #1657 · fastapi/sqlmodel · GitHub

Repository navigation

✨ Add overload for exec method to support text statement - #1657

Open
YuriiMotov wants to merge 5 commits into
fastapi:mainfrom
YuriiMotov:exec_overload_for_text_statement
Open

YuriiMotov wants to merge 5 commits into
fastapi:mainfrom
YuriiMotov:exec_overload_for_text_statement

Conversation

Copy link
Copy Markdown
Member

Currently session.exec(text("")) works, but leads to static type checker error:

error: No overload variant of "exec" of "Session" matches argument type "TextClause"  [call-overload]
note: Possible overload variants:
note:     def [_TSelectParam: Any] exec(self, statement: Select[_TSelectParam], *, params: Union[Mapping[str, Any], Sequence[Mapping[str, Any]], None] = ..., execution_options: Mapping[str, Any] = ..., bind_arguments: Optional[dict[str, Any]] = ..., _parent_execute_state: Optional[Any] = ..., _add_event: Optional[Any] = ...) -> TupleResult[_TSelectParam]
note:     def [_TSelectParam: Any] exec(self, statement: SelectOfScalar[_TSelectParam], *, params: Union[Mapping[str, Any], Sequence[Mapping[str, Any]], None] = ..., execution_options: Mapping[str, Any] = ..., bind_arguments: Optional[dict[str, Any]] = ..., _parent_execute_state: Optional[Any] = ..., _add_event: Optional[Any] = ...) -> ScalarResult[_TSelectParam]
note:     def exec(self, statement: UpdateBase, *, params: Union[Mapping[str, Any], Sequence[Mapping[str, Any]], None] = ..., execution_options: Mapping[str, Any] = ..., bind_arguments: Optional[dict[str, Any]] = ..., _parent_execute_state: Optional[Any] = ..., _add_event: Optional[Any] = ...) -> CursorResult[Any]

This PR adds overload for Session.exec and AsyncSession.exec to fix this.

Addresses #376

YuriiMotov added the feature New feature or request label Nov 26, 2025
github-actions Bot added the conflicts Automatically generated when a PR has a merge conflict label Feb 20, 2026

This comment was marked as resolved.

github-actions Bot removed the conflicts Automatically generated when a PR has a merge conflict label Feb 21, 2026

riscjh commented Mar 7, 2026

Copy link
Copy Markdown

The issue is still existing. Any reason this isn't merged yet?

Copy link
Copy Markdown

@YuriiMotov Is there anything I can do to help move this PR forward?

This branch has not been deployed

No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL