Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

(where false) is not equivalent to {:where false} #431

Closed
robhanlon22 opened this issue Sep 20, 2022 · 1 comment
Closed

(where false) is not equivalent to {:where false} #431

robhanlon22 opened this issue Sep 20, 2022 · 1 comment

Comments

@robhanlon22
Copy link
Contributor

robhanlon22 commented Sep 20, 2022

This works:

(sql/format {:select :foo :where false}) 
;; => ["SELECT foo WHERE false"]

This disregards the false:

(sql/format (-> (select :foo) (where false)))
;; => ["SELECT foo"]

It can be worked around like this:

(sql/format (-> (select :foo) (where [false])))
;; => ["SELECT foo WHERE (FALSE)"]

But it would be best if the behavior was consistent. Appears to be an impedance mismatch between SQL and Clojure :)

@robhanlon22
Copy link
Contributor Author

I can look into this but I am a bit concerned to muck around too much with the generic function in helpers.clj.

seancorfield added a commit that referenced this issue Sep 20, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant