[WIP] [DBAL-218] Add bulk insert query

This is an approach to make use of database vendors' bulk row insert query syntax.
As the nature of bulk inserts usually is to insert a LOT of rows into a table (primarily from an external source), the implementation tries to focus on good performance and low memory consumption. It is NOT intended for `INSERT INTO ... SELECT ...` statement queries.

TODO:

- Add an "executor" class that encapsulates the `BulkInsertQuery` object, adds options like bulk size and internally automatically evaluates the underlying platform's limits for a single `INSERT` statement and splits queries accordingly.
- Evaluate platforms' max insert rows per `INSERT` statement and implement in platforms.
- Add unit tests for quoted identifiers.
- Add functional tests.

Future additions:

- Add support for expressions.
- Query builder (if there will be more bulk insert queries like `INSERT INTO ... SELECT ...`)?

Open for discussion. Ideas welcome!
I don't usually include sadnesses from libraries unless they're packaged  
with PHP Core.

-----Original message-----
From: Marco Pivetta <notifications@github.com>
To: doctrine/dbal <dbal@noreply.github.com>
Cc: Eric Wastl <topaz.github@lt3.us>
Sent: 2014 Dec, Tue, 16 20:49:42 GMT+00:00
Subject: Re: [dbal] [WIP] [DBAL-218] Add bulk insert query (#682)

> @@ -595,6 +595,16 @@ public function getBinaryDefaultLength()
>      }
>  
>      /**
> +     * Returns the maximum number of rows that can be inserted in a  
single INSERT statement.
> +     *
> +     * @return integer
> +     */
> +    public function getInsertMaxRows()
> +    {
> +        return 0;

#sigh. @topaz is this already on phpsadness?

---
Reply to this email directly or view it on GitHub:
https://github.com/doctrine/dbal/pull/682/files#r21930841