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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Interval * Integer operator for PG #1639

Closed
LasseBP opened this Issue Apr 12, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@LasseBP

LasseBP commented Apr 12, 2018

Postgres supports the Interval * Integer operator, which is needed for certain queries, but is not currently implemented in Diesel. It would be nice to have in Diesel.

@sgrif sgrif added this to the 1.3 milestone May 3, 2018

sgrif added a commit that referenced this issue May 4, 2018

Allow operators to be used in more places
This implements `std::ops::{Add, Sub, Mul, Div}` for every type I could
think of. I've done this by introducing a new derive that we can use for
any type with a `where` clause on its `Expression` impl. I've left it
undocumented for now, because I think we may just want to bake this into
a different derive once RFC 2056 is stable.

I've also cleaned up the SQL type implementations, and added new ones
for `Interval`.

Fixes #1639.

sgrif added a commit that referenced this issue May 16, 2018

Allow operators to be used in more places
This implements `std::ops::{Add, Sub, Mul, Div}` for every type I could
think of. I've done this by introducing a new derive that we can use for
any type with a `where` clause on its `Expression` impl. I've left it
undocumented for now, because I think we may just want to bake this into
a different derive once RFC 2056 is stable.

I've also cleaned up the SQL type implementations, and added new ones
for `Interval`.

Fixes #1639.

@sgrif sgrif closed this in #1679 May 16, 2018

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