Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Batch insert or update through Doctrine DBAL Query Builder

How can i do batch insert or update functionality through Doctrine DBAL Query Builder.

$qb = $queryBuilder->values(
        array(
            "name" => 'test'
            "email" => '[email protected]'
        )
    )
    ->insert('test')
    ->execute();

Will it supports like this

$qb = $queryBuilder->values(
            array(
                "name" => array('test', 'test2')
                "email" => array('[email protected]','[email protected]')
            )
        )
        ->insert('test')
        ->execute();
like image 683
Simhachalam Gulla Avatar asked Sep 18 '25 08:09

Simhachalam Gulla


1 Answers

There is an unmerged pullrequest from some time ago, that adds this. You can try to duplicate some of this functionality in your code.

In other words - no, it's not possible to do bulk insert using DBAL.

like image 104
Tomáš Fejfar Avatar answered Sep 20 '25 23:09

Tomáš Fejfar