Skip to content

Commit

Permalink
feat: skip missing uniques
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko committed Dec 16, 2024
1 parent cda42f0 commit 317b952
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Db/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit 317b952

Please sign in to comment.