Assert expression equality #8446
-
I am looking for a method to assert whether two Expression instances are equal (read: compile to the same SQL). Just asserting equality doesn't work ( I am not super familiar with the internals but I assume that this isn't surprising but for completeness: TABLE.order_by("id") == TABLE.order_by("id") returns So I was wondering whether there is a method that could do this. Currently, I am using the result of |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Thanks for opening a discussion. In general I would recommend against depending on the specifics of the generated SQL if possible. Details like quoting, or the specific functions used to implement a feature may change across minor releases. Expressions have a public
|
Beta Was this translation helpful? Give feedback.
Thanks for opening a discussion.
In general I would recommend against depending on the specifics of the generated SQL if possible.
Details like quoting, or the specific functions used to implement a feature may change across minor releases.
Expressions have a public
equals
method that allows you to do the kind of comparison you're talking about: