Can HoneySQL further transform parameterized SQL into pure SQL? E.g. instead of
(-> (insert-into :properties)
(columns :name :surname :age)
(values
[["Jon" "Smith" 34]
["Andrew" "Cooper" 12]
["Jane" "Daniels" 56]])
sql/format)
=> [#sql/regularize
"INSERT INTO properties (name, surname, age)
VALUES (?, ?, ?), (?, ?, ?), (?, ?, ?)"
"Jon" "Smith" 34 "Andrew" "Cooper" 12 "Jane" "Daniels" 56]
is there something that can return
"INSERT INTO properties (name, surname, age)
VALUES ("Jon", "Smith", 34),
("Andrew", "Cooper", 12)
("Jane", "Daniels", 56)"
No, because HoneySQL doesn't know how to transform Clojure values to SQL fragments -- that's handled by the JDBC driver when the statement is being prepared (in clojure.java.jdbc
or next.jdbc
).
Thanks @seancorfield, good to know