public function batchInsert($table, array $data, $extra = null)
    {
        $table = $this->getTable($table);
        $field = implode(', ', array_keys($data[0]));
        $placeholders = array();
        $values = array();

        switch ($this->driver) {
            default:
            case 'mysql':
            case 'pgsql':
                foreach ($data as $row) {
                    $placeholders[] = '(' . implode(', ', array_pad(array(), count($row), '?')) . ')';
                    $values = array_merge($values, array_values($row));
                }
                $placeholder = 'VALUES ' . implode(', ', $placeholders);
                break;

            // For SQLite before 3.7.11, http://www.sqlite.org/releaselog/3_7_11.html
            case 'sqlite':
                foreach ($data as $row) {
                    $placeholders[] = 'SELECT ' . implode(', ', array_pad(array(), count($row), '?'));
                    $values = array_merge($values, array_values($row));
                }
                $placeholder = implode(' UNION ', $placeholders);
                break;
        }

        $query = "INSERT INTO $table ($field) $placeholder";
        $extra && $query .= ' ' . $extra;

        return $this->executeUpdate($query, $values);
    }