Clojurians
#luminus
<
2016-07-25
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

rui.yang07:07:43

Hi, wonder how people normally use Hugsql’s tuple? aka the batch insert?

rui.yang07:07:51

do you have to give a vector of vector for the value list? normally the json body is a map containing a vector of maps, which means we need to convert that map to a vector with the correct order

curtis.summers21:07:18

@rui.yang Author of HugSQL here. Inserts with the tuple parameter type has its limits--especially if you're inserting a lot of data. Depending on your use case, I'd suggest: 1) looping through your data in a transaction and calling your insert function multiple times, 2) the underlying clojure.java.jdbc multi-insert might be just what you need, or 3) use HugSQL's Clojure Expressions to build a "generic insert" (See the clj-expr-generic-update example: http://www.hugsql.org/#using-expressions)

curtis.summers21:07:07

@rui.yang That clojure.java.jdbc function should be insert-multi!

rui.yang22:07:30

@curtis.summers thanks for the tips