Fork me on GitHub
#sql
<
2022-11-15
>
tlonist05:11:21

is there any way to mute the result of insertion when using next.jdbc? I'm trying to conduct a benchmark test using Clojure + next.jdbc, and need to insert hundreds of thousands of rows. It prints the result everytime when insertion is made; and it's a nuisance for the purpose of experiment.

seancorfield05:11:54

next.jdbc should not be printing anything.

seancorfield05:11:26

@U01TFN2113P The only printing at all anywhere in the next.jdbc codebase is in its tests -- the library itself does not printing. Any printout you're seeing must be coming from your own code. Can show the code you are benchmarking?

tlonist05:11:25

[#:next.jdbc{:update-count 1}]
I get this output after executing an insert. My mistake - it is not a print. But a result of function call.. which is inevitable I guess!

seancorfield05:11:21

Yeah, functions return results 🙂

tlonist05:11:37

silly question, thanks!

seancorfield05:11:17

If you need to bulk insert, you'll want to use execute-batch! for the insert and you'll need to tune various settings -- which are database-specific and several DBs are mentioned in the docs.

seancorfield05:11:15

In particular, some DBs require connection parameters in order to force batch execution of statements/inserts.

👍 1