Fork me on GitHub
#honeysql
<
2021-11-08
>
Aviv Kotek15:11:42

hi, i'm trying to generate dynamic "batch" query via honey-sql + clojure.java.jdbc

(let [q ["INSERT INTO fruit2 ( name, appearance, cost, grade ) VALUES ( ?, ?, ?, ? )"
         ["a","b", "c", "d"], v2......vN]]
  (sql/db-do-prepared db q {:multi? true}))
where vec2...vecN are some row data dynamically given I have tried something like that:
(-> (insert-into :fruit2)
    (columns :name :appeareance :cost :grade)
    (values [:?values])
    (sql/format {:params {:values sequences}})
but this is not supported by values API, how can I built the query with dynamic given params? thx!