title: Cakephp 3.0 bulk insert
body: <p>In Cakephp 3.0, to <strong>save many records</strong>, it is instructed to use the <code>saveMany</code> function. </p>
  
  <p><a href="https://book.cakephp.org/3.0/en/orm/saving-data.html#saving-multiple-entities" rel="nofollow noreferrer">https://book.cakephp.org/3.0/en/orm/saving-data.html#saving-multiple-entities</a></p>
  
  <p>However, the above submit insert statement <strong>one by one</strong>.</p>
  
  <p>I need to updated a few thousand of records at once, so I would like to <strong>batch insert my records</strong> instead of insert it one by one.</p>
  
  <p>To verified this I tried <code>saveMany</code> behavior I inspected my <code>querys.log</code> it appears that using <code>saveMany</code> does not insert my query at a batch, and indeed insert it one by one.</p>
  
  <p>In other word, I would like to have this:</p>
  
  <pre><code>INSERT INTO mytable (id, code) VALUES ('123', 'code_a'), ('123', 'code_b'), ('123', 'code_c'), ('123', 'code_d'), ('123', 'code_e');
  </code></pre>
  
  <p>But instead the following was executed</p>
  
  <pre><code>INSERT INTO mytable (id, code) VALUES ('123', 'code_a')
  INSERT INTO mytable (id, code) VALUES ('123', 'code_b')
  INSERT INTO mytable (id, code) VALUES ('123', 'code_c')
  INSERT INTO mytable (id, code) VALUES ('123', 'code_d')
  INSERT INTO mytable (id, code) VALUES ('123', 'code_e')
  </code></pre>
  
  <p>So my question is, how can I do <strong>bulk insert</strong> in <strong>Cakephp 3.0</strong></p>
  
  <p>Note: I do some research and see that a <code>saveAll</code> function was in <strong>Cakephp 2.0</strong> and it can do batch processing (supposedly), but sadly such function is not present in 3.0.</p>