Fork me on GitHub

HoneySQL -- Turn Clojure data structures into SQL -- com.github.seancorfield/honeysql {:mvn/version "2.4.962"} -- -- the "big ticket" item is #405: the long-requested ability to generate SQL with numbered placeholders (`$1`, $2, etc) instead of positional placeholders (`?`) which means you can now use HoneySQL with the Node.js PostgreSQL driver! The release also contains a number of bug fixes: • Fix set-options! (only :checking worked in 2.4.947). • Fix :cast formatting when quoting is enabled, via PR • Fix by adding :replace-into to in-flight clause order (as well as registering it for the :mysql dialect). • Fix by special-casing :'ARRAY. • Fix by supporting additional WITH syntax, via PR, [Technically, this was in 2.4.947, but I kept the issue open while I wordsmithed the documentation] • Address by adding :numbered option, which can also be set globally using set-options!. Follow-up in #honeysql

🍯 23
clojure-spin 9
🙌 1
👏 1

Works with #C029PTWD3HR :

$ nbb -e "(require 'honey.sql) (honey.sql/format {:select :* :from :table :where [[:= :x 2]]} {:numbered true})"
["SELECT * FROM table WHERE (x = $1)" 2]
I'm sure a couple of people will be happy with this in nbb :)

eccentric J18:12:45

@U04V15CAJ Exactly! All the node pg adapters used that format so this opens sooo many doors 🚪