php-activerecord
php-activerecord copied to clipboard
How to correct insert multiple rows?
Continue theme: Support for multi-row inserts and INSERT IGNORE
What do you think about hacking Model::create()
into a Model::create_all()
?
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)
Has this been implemented?
Hi! I can't find any information about batch insert. Anybody know something?