Skip to content

Commit

Permalink
Ignore bulk insert errors
Browse files Browse the repository at this point in the history
  • Loading branch information
abnegate committed Aug 20, 2023
1 parent 779a0aa commit b9f62a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Database/Adapter/MariaDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ public function createDocuments(string $collection, array $documents, int $batch
}

$stmt = $this->getPDO()->prepare("
INSERT INTO {$this->getSQLTable($name)} {$columns}
INSERT IGNORE INTO {$this->getSQLTable($name)} {$columns}
VALUES " . \implode(', ', $batchKeys)
);

Expand All @@ -628,7 +628,7 @@ public function createDocuments(string $collection, array $documents, int $batch

if (!empty($permissions)) {
$stmtPermissions = $this->getPDO()->prepare("
INSERT INTO {$this->getSQLTable($name . '_perms')} (_type, _permission, _document)
INSERT IGNORE INTO {$this->getSQLTable($name . '_perms')} (_type, _permission, _document)
VALUES " . \implode(', ', $permissions)
);
$stmtPermissions?->execute();
Expand Down

0 comments on commit b9f62a9

Please sign in to comment.