|
1 | | -;; Copyright (c) 2008-2018 Sean Corfield, Stephen C. Gilardi. All rights reserved. |
| 1 | +;; Copyright (c) 2008-2019 Sean Corfield, Stephen C. Gilardi. All rights reserved. |
2 | 2 | ;; The use and distribution terms for this software are covered by |
3 | 3 | ;; the Eclipse Public License 1.0 |
4 | 4 | ;; (http://opensource.org/licenses/eclipse-1.0.php) which can be |
@@ -1612,9 +1612,16 @@ http://clojure-doc.org/articles/ecosystem/java_jdbc/home.html"} |
1612 | 1612 | When inserting rows as a sequence of lists of column values, the result is |
1613 | 1613 | a sequence of the counts of rows affected (a sequence of 1's), if available. |
1614 | 1614 | Yes, that is singularly unhelpful. Thank you getUpdateCount and executeBatch! |
1615 | | - A single database operation is used to insert all the rows at once. This may |
1616 | | - be much faster than inserting a sequence of rows (which performs an insert for |
1617 | | - each map in the sequence). |
| 1615 | + A single database operation should be used to insert all the rows at once. |
| 1616 | + This may be much faster than inserting a sequence of rows (which performs an |
| 1617 | + insert for each map in the sequence). |
| 1618 | +
|
| 1619 | + Note: some database drivers need to be told to rewrite the SQL for this to |
| 1620 | + be performed as a single, batched operation. In particular, PostgreSQL |
| 1621 | + requires :reWriteBatchedInserts true and My SQL requires |
| 1622 | + :rewriteBatchedStatement true (both non-standard JDBC options, of course!). |
| 1623 | + These options should be passed into the driver when the connection is |
| 1624 | + created (however that is done in your program). |
1618 | 1625 |
|
1619 | 1626 | The :transaction? option specifies whether to run in a transaction or not. |
1620 | 1627 | The default is true (use a transaction). The :entities option specifies how |
|
0 commit comments