Re: Possible RFC: PDOStatement::addBatch
| From: | mickmackusa | Date: | Mon, 19 Jun 2023 21:17:48 +0000 |
| Subject: | Re: Possible RFC: PDOStatement::addBatch | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-120628@lists.php.net to get a copy of this message | ||
So if I'm not missing something, you want to add this new method to core to
accommodate situations where:
1. the dev is too inexperienced to implement a pre-existing library and
2. the incoming 2d payload is not packaged as a csv file (and therefore
cannot be directly imported as such) and
3. the application does not benefit from accessing the auto-incremented ids
generated by each insert and
4. the performance of the bulk insertions resolves a crippling bottleneck
in performance?
IMO, the total footprint of your implemented snippet isn't significantly
"sleeker/sexier" than using concatenation. I don't see anything ugly or
unreadable about building two flat arrays, then using them to construct a
SQL string and feed the execute() method. https://phpize.online/s/iW
I am not an RFC voter, but I don't really see a compelling reason to add
this method to the language.
mickmackusa