Skip to content

Implement IntoSimpleExpr for FunctionCall#2822

Merged
tyt2y3 merged 2 commits intoSeaQL:masterfrom
joleeee:into_function
Feb 27, 2026
Merged

Implement IntoSimpleExpr for FunctionCall#2822
tyt2y3 merged 2 commits intoSeaQL:masterfrom
joleeee:into_function

Conversation

@joleeee
Copy link
Copy Markdown
Contributor

@joleeee joleeee commented Nov 25, 2025

PR Info

No issue, but see question "FunctionCall and IntoSimpleExpr" in the discord.

New Features

Bug Fixes

allows you to do sea_orm::query::helper::QueryOrder::order_by_asc with an argument of FunctionCall directly, without having to wrap it in Expr::Functioncall

example patch i can apply to my project due to this patch:

 Ok(locations::Entity::find()
     .filter(locations::Column::Userid.eq(userid))
     .filter(dist.clone().lt(5000))
-    .order_by_asc(Expr::FunctionCall(dist))
+    .order_by_asc(dist)
     .all(tx)
     .await?)

Breaking Changes

Changes

@joleeee joleeee marked this pull request as ready for review November 26, 2025 17:37
@Huliiiiii Huliiiiii requested review from Expurple and tyt2y3 November 28, 2025 14:28
Copy link
Copy Markdown
Member

@Expurple Expurple left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember correctly, now we have a blanket impl IntoSimpleExpr for T: Into<SimpleExpr> to make IntoSimpleExpr interchangable with Into<SimpleExpr>. To get that benefit, your new impl should be worded as impl From<FunctionCall> for SimpleExpr.

Good change otherwise! Thank you

@tyt2y3 tyt2y3 merged commit efc58b0 into SeaQL:master Feb 27, 2026
33 checks passed
@github-actions
Copy link
Copy Markdown

🎉 Released In 2.0.0-rc.35 🎉

Huge thanks for the contribution!
This feature has now been released, so it's a great time to upgrade.
Show some love with a ⭐ on our repo, every star counts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants