php-activerecord icon indicating copy to clipboard operation
php-activerecord copied to clipboard

How to correct insert multiple rows?

Open sorbing opened this issue 12 years ago • 4 comments

What do you think about hacking Model::create() into a Model::create_all()?

greut avatar Jul 30 '12 13:07 greut

Maybe it would be more correct:

$affected_rows = Model::insert_bath($aRows, $batch_size);
$aRows - array with data rows;
$batch_size - size package for inserts at one query

From method Model::create() we expect the model (Object), with multiple insert need to get the number of records inserted. Will not be the number of records returned by confusing a programmers? However, I 'm not sure how to do split batch on some queries. This is a very common and useful feature. I hope google translate clear translated the text)

sorbing avatar Jul 30 '12 13:07 sorbing

Has this been implemented?

azitabh avatar Jan 29 '14 07:01 azitabh

Hi! I can't find any information about batch insert. Anybody know something?

ruslantolstov avatar Jun 03 '16 08:06 ruslantolstov