Updated insert-multi! docstring

Removed caveat about batching (doesn't apply) but added caveat about 
size/parameter limits.
This commit is contained in:
Sean Corfield 2019-07-08 17:21:28 -07:00
parent dcb632d7cf
commit 58aeff56f7

View file

@ -192,10 +192,10 @@
multiple rows in the database and attempts to return a vector of maps of
generated keys.
Note: some database drivers need to be told to rewrite the SQL for this to
be performed as a single, batched operation. In particular, PostgreSQL
requires the `:reWriteBatchedInserts true` option and MySQL requires
`:rewriteBatchedStatement true` (both non-standard JDBC options, of course!)."
Note: this expands to a single SQL statement with placeholders for every
value being inserted -- for large sets of rows, this may exceed the limits
on SQL string size and/or number of parameters for your JDBC driver or your
database!"
([connectable table cols rows]
(insert-multi! connectable table cols rows {}))
([connectable table cols rows opts]
@ -203,6 +203,15 @@
(for-insert-multi table cols rows opts)
(merge {:return-keys true} opts))))
(comment
;; removed this caveat from insert-multi! because it doesn't apply --
;; these DB-specific options are only needed when you have batched
;; parameters and the driver needs a "hint" to perform an actual batch op!
"Note: some database drivers need to be told to rewrite the SQL for this to
be performed as a single, batched operation. In particular, PostgreSQL
requires the `:reWriteBatchedInserts true` option and MySQL requires
`:rewriteBatchedStatement true` (both non-standard JDBC options, of course!).")
(defn query
"Syntactic sugar over `execute!` to provide a query alias.