sql 2024-09-25

how do you handle big tables with multple columns in an execute! block?

Not sure what you're asking here? Execute! accepts regular SQL...

The real question was :D i have an insert into with lots of fields 16+ how can i do the insert dynamically is that even possible ootb or do i have to write that on my own. Something like

(defn insert [fields]
   (execute! db ["insert into(all, my, fields, ...) values (?,?,?,...)" fields]))

(next.jdbc.sql/insert! db :table {hash map of data}) perhaps?

❤️ 1

Or maybe look at HoneySQL to generate SQL for you?

Exactly what i was looking for sorry for not looking that up on my own

If you need something more sophisticated, use HoneySQL.

No clue why but i wanted to avoid it as long as possible. Guess i'll end up with it like all others before.

as i allready pointed out 😄 i'm at the point that i'll include honeysql 😄

👍🏻 1

Lots of help available in #honeysql (and here for the non-HoneySQL parts)! 🙂