Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

✨ Add overload forexec method to supporttext statement#1657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
YuriiMotov wants to merge1 commit intofastapi:main
base:main
Choose a base branch
Loading
fromYuriiMotov:exec_overload_for_text_statement

Conversation

@YuriiMotov
Copy link
Member

Currentlysession.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 forSession.exec andAsyncSession.exec to fix this.

Addresses#376

@YuriiMotovYuriiMotov added the featureNew feature or request labelNov 26, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

featureNew feature or request

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@YuriiMotov

[8]ページ先頭

©2009-2025 Movatter.jp