How to get the type for a SQL numeric operation, like Add or Sub ? #4461
Unanswered
dessalines
asked this question in
Q&A
Replies: 2 comments 4 replies
-
It seems like these type definitions are still missing. I would appreciate a PR that adds them to diesel::dsl. For |
Beta Was this translation helpful? Give feedback.
4 replies
-
Gotcha. It might be a while until I can get to this, so I'll create an issue for it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'd like to use a subtract operation be used as a
select_expression
.This gets the number of unread comments in a post:
post_aggregates::comments - post_actions::read_comments_amount
This unfortunately can't use
auto_type
, and I also can't strictly define the type, since theSub
numeric operation is in a private module :diesel::expression::ops::numeric::Sub
My output type should be something like:
Is there any way to get the type from a numeric operation?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions