Fork me on GitHub
#honeysql
<
2021-06-21
>
borkdude14:06:39

How do I express x is not null in honeysql?

borkdude14:06:10

[:raw "username is not null"]
:)

john-shaffer14:06:21

[:not= nil :username]

seancorfield14:06:49

dev=> (sql/format {:where [:is-not nil :x]})
["WHERE x IS NOT NULL"]
dev=> (sql/format {:where [:<> nil :x]})
["WHERE x IS NOT NULL"]
dev=> (sql/format {:where [:not= nil :x]})
["WHERE x IS NOT NULL"]

borkdude16:06:37

the possibilities are endless!