nws/db-bulk

Bulk inserts, insert on duplicate key updates, for mysql and postgresql

dev-master 2020-11-25 13:04 UTC

This package is not auto-updated.

Last update: 2021-09-02 15:17:31 UTC


README

Multiple rows insert and insert on duplicate key update.

$rows = [
    ['col1' => 1, 'col2' => 1],
    ['col1' => 1, 'col2' => 2]
];
$excludedColumns = ['col1'];
$uniqueColumns = ['col1', 'col2'];
\NWS\DBBulk\DBBulkFacade::insertOrUpdate('table_name', $rows, $excludedColumns, $uniqueColumns);