-
-
Notifications
You must be signed in to change notification settings - Fork 176
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
Cast seems to be breaking with a type named "*-type" in v2.4.962 #507
Comments
That seems to be a side-effect of #443 in order to avoid (incorrect) quoting -- and also to uppercase type names in that context. |
You can use the quoted-keyword form to avoid that: user=> (require '[honey.sql :as h])
nil
user=> (h/format [:cast :foo :bar-type])
["CAST(foo AS BAR TYPE)"]
user=> (h/format [:cast :foo :'bar-type])
["CAST(foo AS bar_type)"] I'll have to give this some thought because the original behavior was incorrect with quoting but the new behavior is a breaking change for some types. |
There's a Postgres-related test in the suite: (is (= ["SELECT foo, CAST(bar AS DOUBLE PRECISION)"] ;; Postgres example
(sql/format {:select [:foo [[:cast :bar :double-precision]]]}))) To keep that working I'll update the |
@seancorfield Thanks for your confirmation!
OK. I'll change to use |
change of behavior was in december 2022 (2.4.962).
I've added several examples to the Special Syntax description of |
Expected
[:cast :foo :bar-type]
should be formatted toCAST(foo AS bar_type)
.Actual
[:cast :foo :bar-type]
is formatted toCAST(foo AS BAR TYPE)
with v2.4.962 or above.How to reproduce
The text was updated successfully, but these errors were encountered: