[TYPO3-core] RFC #12858: Feature: Provide a DB API to insert multiple rows at once

Xavier Perseguers typo3 at perseguers.ch
Mon Jan 11 00:09:18 CET 2010


Hi,

> attached v2 taking Xaviers remarks into account:
>
> - fields and rows must be given as arrays
> - Added two methods to dbal (successfully tested the first one with the
> test from enetcache with installed dbal, native)

Well, from reading it certainly works but it's not optimal at all when you use DBAL and a native handler as you don't use extended INSERT anymore. You should have something like that for instance for 
your exec_ method:

switch ((string)$this->handlerCfg[$this->lastHandlerKey]['type']) {
	case 'native':
		return parent::exec_INSERTmultipleRows($table, $fields, $rows, $no_quote_fields);
	default:
		foreach ($rows as $row) {
			...
		}
}

This may be written another way as testing the 'native' handler could be done as an early return but the idea is this one, just as for the other exec_ methods.

-- 
Xavier Perseguers
http://xavier.perseguers.ch/en


More information about the TYPO3-team-core mailing list