From 317b952165b6d3780ef288d3cfa2d5d1b0d763eb Mon Sep 17 00:00:00 2001 From: mychidarko Date: Mon, 16 Dec 2024 18:15:00 +0000 Subject: [PATCH] feat: skip missing uniques --- src/Db/Core.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Db/Core.php b/src/Db/Core.php index 24ae4d4..4c66907 100644 --- a/src/Db/Core.php +++ b/src/Db/Core.php @@ -224,7 +224,7 @@ protected function dsn(): string } if ($this->config('charset')) { if ($dbtype === 'pgsql') { - $dsn .= ';options=\'--client_encoding='.$this->config('charset').'\''; + $dsn .= ';options=\'--client_encoding=' . $this->config('charset') . '\''; } else { $dsn .= ';charset=' . $this->config('charset'); } @@ -353,7 +353,8 @@ public function execute() if ($IS_UPDATE || $IS_INSERT) { foreach ($state['uniques'] as $unique) { if (!isset($state['params'][$unique])) { - trigger_error("$unique not found, Add $unique to your insert or update items or check your spelling."); + // trigger_error("$unique not found, Add $unique to your insert or update items or check your spelling."); + continue; } if ($this->connection->query("SELECT * FROM {$state['table']} WHERE $unique='{$state['params'][$unique]}'")->fetch(\PDO::FETCH_ASSOC)) {