Skip to content

Commit 317b952

Browse files
committed
feat: skip missing uniques
1 parent cda42f0 commit 317b952

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Db/Core.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ protected function dsn(): string
224224
}
225225
if ($this->config('charset')) {
226226
if ($dbtype === 'pgsql') {
227-
$dsn .= ';options=\'--client_encoding='.$this->config('charset').'\'';
227+
$dsn .= ';options=\'--client_encoding=' . $this->config('charset') . '\'';
228228
} else {
229229
$dsn .= ';charset=' . $this->config('charset');
230230
}
@@ -353,7 +353,8 @@ public function execute()
353353
if ($IS_UPDATE || $IS_INSERT) {
354354
foreach ($state['uniques'] as $unique) {
355355
if (!isset($state['params'][$unique])) {
356-
trigger_error("$unique not found, Add $unique to your insert or update items or check your spelling.");
356+
// trigger_error("$unique not found, Add $unique to your insert or update items or check your spelling.");
357+
continue;
357358
}
358359

359360
if ($this->connection->query("SELECT * FROM {$state['table']} WHERE $unique='{$state['params'][$unique]}'")->fetch(\PDO::FETCH_ASSOC)) {

0 commit comments

Comments
 (0)