honeysql

Discussion of https://github.com/seancorfield/honeysql :slightly_smiling_face:
agigao 2020-03-09T18:52:05.019600Z

Hey Clojurians, I'm kinda confused about interpreting NOT IN through honeySQL. Any pointers?

seancorfield 2020-03-09T19:23:20.020Z

@chokheli Can you share what you've tried so far?

seancorfield 2020-03-09T19:29:37.020500Z

(! 776)-> clj -Sdeps '{:deps {honeysql {:mvn/version "RELEASE"}}}'
Clojure 1.10.1
user=> (require '[honeysql.core :as h] '[honeysql.helpers :refer :all])
WARNING: update already refers to: #'clojure.core/update in namespace: user, being replaced by: #'honeysql.helpers/update
nil
user=> (-> (select :*) (from :table) (where [:not-in :id [1 2 3 4]]) (h/format))
["SELECT * FROM table WHERE (id not in (?, ?, ?, ?))" 1 2 3 4]
user=> 
Is that not what you're looking for?

agigao 2020-03-09T19:39:01.021700Z

Damn, as always in Clojure it's the simplest solution which I just overlook. Thanks Sean!