SkyPHP/skyphp — Issue #17: Multi-Insert Idea
Author: stanistan
Created: 2012-01-09 18:09:29+00:00
State: open
Labels: aql

Right now, we have this insert structure:

```php
'Pink Floyd'
),
array(
'name' => 'Metallica',
'year_started' => 'Not sure'
),
array(
'name' => 'Sleepytime Gorilla Museum',
'genre' => 'weird' // not actual genre schema,
),
array(
'name' => 'Radiohead'
),
// etc
);

aql::multi_insert($table_name, $fields);
```

This would figure out the minimum number of insert queries for field-data pairs given and insert them in a transaction. If all of the fields are the same, then this would be minimized to one query which would be much faster than the current alternative.

If ```aql::insert()``` contains a multi-dimensional array, ```multi_insert()``` would be used instead.

*Note:* this would not return an array of rows inserted.